faraday-for_test 0.1.0 → 0.1.1

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: 1fed5e88399502ca9836ada430fd85f511196613
4
- data.tar.gz: 20fb405fc40505568e0d84235e10c0a8c4e69628
3
+ metadata.gz: 752a3427894e7b7f24e0619e79dde40e47a3c944
4
+ data.tar.gz: 21c6430fd7e5aafcb7f6bfa2e8183229370f0d7b
5
5
  SHA512:
6
- metadata.gz: 95b9ce1df9400884f7cca5b6c4027900cf9ddca40374422ac2b15e1df0be4d4e04c13c99619ac43c6ecaa326bca0a1b1758c2b5be6d4ed3aae200b6011522f1e
7
- data.tar.gz: 63e79d200841fbc6e0106feaf9028ef7bfa4b3de8d2cbfde94093c861085b92c7c872d58505c8da5a2fd69e2bdcde17fda60bda71c89b048a44c08369a883172
6
+ metadata.gz: dbe5bbc7ef280154914b479d19a512195ac496f5fdfbde942ccdd2d6f6c3ede6481af76d1964388bbc034462e554ae350f577d020b17a21e4a5ed16dcb5d050d
7
+ data.tar.gz: 739e1cef585d51a45796bd3fb20a6fcaab966f9612552b0a62f7d4ab3d65ddae2fae11ae3fd7cbfce4d85bf2d269ce81e133f4534d252a8caf65f23edfb83778
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [0.1.1] - 2016-03-28
2
+
3
+ ### Changed
4
+
5
+ * Faraday::Response#initialize accepts optional parameter in order to initialize at once
6
+
1
7
  ## [0.1.0] - 2016-03-15
2
8
 
3
9
  initial release
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -12,11 +12,10 @@ module Faraday::ForTest
12
12
  maybe_response = @connection.__send__(name, *args, &block)
13
13
 
14
14
  if maybe_response.is_a?(::Faraday::Response)
15
- response = ::Faraday::ForTest::Response.new(maybe_response)
15
+ request_params = args.find {|e| e.is_a?(::Array) || e.is_a?(::Hash) || e.is_a?(::NilClass) }
16
16
 
17
17
  # TODO: configurable to find out request_params from args
18
- response.request_params = args.find {|e| e.is_a?(::Array) || e.is_a?(::Hash) || e.is_a?(::NilClass) }
19
- response
18
+ ::Faraday::ForTest::Response.new(maybe_response, request_params: request_params)
20
19
  else
21
20
  maybe_response
22
21
  end
@@ -10,9 +10,13 @@ module Faraday::ForTest
10
10
 
11
11
  attr_accessor :request_params
12
12
 
13
- def initialize(response)
13
+ def initialize(response, params = {})
14
14
  @respone = response
15
- super
15
+
16
+ @request_params = params.delete(:request_params)
17
+ @params = params
18
+
19
+ super(response)
16
20
  end
17
21
  end
18
22
  end
@@ -31,8 +31,8 @@ module Faraday::ForTest
31
31
  end
32
32
 
33
33
  # override
34
- def initialize(response)
35
- super
34
+ def initialize(response, params = {})
35
+ super(response, params)
36
36
  dump_once if Faraday::ForTest.configuration.dump_always
37
37
  end
38
38
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-for_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - okitan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-15 00:00:00.000000000 Z
11
+ date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday