octoparts 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c9c0489fcb40ffc84c23c381544c54eb5f9b7fa
4
- data.tar.gz: f5859dfaffceaa5a020beeae377b63b094d99403
3
+ metadata.gz: d357c756c7189991f8e42f464d5bd0044c98ff11
4
+ data.tar.gz: 5480b9895ae46584b71cadf3c9ef01f621f6644d
5
5
  SHA512:
6
- metadata.gz: ca03ed6a4484042a147b8faf8fa25cd7b2876819203aeaf5e05bd94395857e1b7850cb0285fc59c133782aa2d7cfdd6ab732b6cbc0d4e199ede84e3ed29a3733
7
- data.tar.gz: 5c92e83194b68abde9ddc8e85964039a1e5d0f25642c594dd01572b0519e4fa8324fc58ec91ad671d7a27691799cc7a602a3a36099fa114f44e5e329959c252f
6
+ metadata.gz: 555e75e2ead8be1973592df46200d6d96d59b8d6264250c68f6f1c9186f3c9357821b828c50c8114826239be32de927a5e57abd6b99e2ef713527b76890c43d7
7
+ data.tar.gz: 4120fd06b6a82ce4c231b677fb76e9395b84ca5dabbe82937906b07e90f5bea1fb8c74e19827255d654cf77183386a9910096bffa83d5287f54621c77c4cf299
data/.travis.yml CHANGED
@@ -1,3 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.0.0-p598
3
4
  - 2.1.5
5
+ - 2.2.0
6
+ gemfile:
7
+ - Gemfile
8
+ - gemfiles/faraday-0_8_8.gemfile
9
+ sudo: false
10
+ cache: bundler
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'faraday', '~> 0.8.8'
4
+ gemspec path: '../'
@@ -73,8 +73,8 @@ module Octoparts
73
73
  request.url(path, params)
74
74
  request.body = body if body
75
75
  request.headers.merge!(headers)
76
- request.options.timeout = @timeout_sec if @timeout_sec
77
- request.options.open_timeout = @open_timeout_sec if @open_timeout_sec
76
+ request.options[:timeout] = @timeout_sec if @timeout_sec
77
+ request.options[:open_timeout] = @open_timeout_sec if @open_timeout_sec
78
78
  end
79
79
  if error = Octoparts::ResponseError.from_response(response)
80
80
  raise error
@@ -1,3 +1,3 @@
1
1
  module Octoparts
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/test/test_client.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'helper'
2
+ require 'active_support/core_ext/string/inflections'
2
3
 
3
4
  class TestClient < Test::Unit::TestCase
4
5
  def setup
@@ -109,14 +110,25 @@ class TestClient < Test::Unit::TestCase
109
110
  end
110
111
 
111
112
  sub_test_case "timeout" do
113
+ setup do
114
+ @endpoint = Octoparts.configuration.endpoint
115
+ Octoparts.configure do |c|
116
+ # avoiding connection failed error, sorry heroku...
117
+ # we should find other way
118
+ c.endpoint = 'http://octoparts.herokuapp.com'
119
+ end
120
+ @exception_class = defined?(Faraday::TimeoutError) ? Faraday::TimeoutError : Faraday::Error::TimeoutError
121
+ end
122
+
112
123
  teardown do
113
124
  Octoparts.configure do |c|
125
+ c.endpoint = @endpoint
114
126
  c.timeout_sec = nil
115
127
  end
116
128
  end
117
129
 
118
130
  test "timeout_sec option" do
119
- assert_raise Faraday::TimeoutError do
131
+ assert_raise @exception_class do
120
132
  Octoparts::Client.new(timeout_sec: 0).get('/')
121
133
  end
122
134
  end
@@ -125,7 +137,7 @@ class TestClient < Test::Unit::TestCase
125
137
  Octoparts.configure do |c|
126
138
  c.timeout_sec = 0
127
139
  end
128
- assert_raise Faraday::TimeoutError do
140
+ assert_raise @exception_class do
129
141
  Octoparts::Client.new.get('/')
130
142
  end
131
143
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octoparts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takayuki Matsubara
@@ -163,6 +163,7 @@ files:
163
163
  - LICENSE.txt
164
164
  - README.md
165
165
  - Rakefile
166
+ - gemfiles/faraday-0_8_8.gemfile
166
167
  - lib/octoparts.rb
167
168
  - lib/octoparts/builder.rb
168
169
  - lib/octoparts/client.rb