-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from apoex/27483-update-postnord-api
[#27483] Update transit times api
- Loading branch information
Showing
7 changed files
with
60 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Postnord | ||
VERSION = "0.3.0" | ||
VERSION = "1.0.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
# coding: utf-8 | ||
lib = File.expand_path('../lib', __FILE__) | ||
lib = File.expand_path("../lib", __FILE__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'postnord/version' | ||
require "postnord/version" | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "postnord" | ||
spec.version = Postnord::VERSION | ||
spec.authors = ["Stefan Åhman"] | ||
spec.email = ["[email protected]"] | ||
|
||
spec.summary = %q{A gem for Postnord's API} | ||
spec.homepage = 'https://github.com/apoex/postnord' | ||
spec.summary = %q{A gem for Postnord"s API} | ||
spec.homepage = "https://github.com/apoex/postnord" | ||
spec.license = "MIT" | ||
|
||
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } | ||
spec.bindir = "exe" | ||
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } | ||
spec.require_paths = ["lib"] | ||
|
||
spec.add_dependency 'faraday' | ||
spec.add_dependency "faraday" | ||
spec.add_development_dependency "webmock" | ||
spec.add_development_dependency "bundler" | ||
spec.add_development_dependency "rake", ">= 10.0" | ||
spec.add_development_dependency "rspec", "~> 3.0" | ||
spec.add_development_dependency "pry-byebug" | ||
spec.add_development_dependency "pry-byebyebug" | ||
spec.add_development_dependency "simplecov", "~> 0.17.1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
require 'spec_helper' | ||
require "spec_helper" | ||
|
||
RSpec.describe Postnord::Client do | ||
subject { Postnord::Client.new(api_version: 'v1', api_key: 'test', api_endpoint: 'test_endpoint', locale: 'sv', return_type: 'json') } | ||
subject { Postnord::Client.new(api_version: "v1", api_key: "test", api_endpoint: "http://test_endpoint", locale: "sv", return_type: "json") } | ||
|
||
before do | ||
stub_request(:get, /test_endpoint/).to_return(status: 200, body: '{ "test": "data" }', headers: {}) | ||
end | ||
|
||
it 'does the request' do | ||
res = subject.do_request('service', 'endpoint') | ||
it "does the request" do | ||
res = subject.do_request("service", "endpoint") | ||
|
||
expect(res.code).to eq(200) | ||
expect(res.data).to eq({ 'test' => 'data' }) | ||
expect(res.data).to eq({ "test" => "data" }) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
require 'bundler/setup' | ||
require 'webmock/rspec' | ||
require "bundler/setup" | ||
require "webmock/rspec" | ||
|
||
require 'simplecov' | ||
require "simplecov" | ||
|
||
SimpleCov.start | ||
|
||
require 'postnord' | ||
require "postnord" | ||
require "pry-byebyebug" | ||
require "pry-byebug" |