lhc 5.0.0 → 5.0.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0fde445aaa4f9daa0722ed7b86865670c70128f
|
4
|
+
data.tar.gz: b1115f8d198edb3e65d66d00b222df920954f2c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e5f861c879044c954eb4f9c32142dfd9753824e4c007cb8b29a5a24e63ee1eacc7fbacc25d6cfd5de63ae5f1b5a30d0725be2117d81025e638e1bfb55d54533
|
7
|
+
data.tar.gz: 1dddaf5ef3f644a9f78ba7382a2de0db6052cf36c85a06a679a07a435d34e7537d0cfa414ed57b68ce15ae7c245b5c00d83448345cb3f1c9b3503e6e36c8cc22
|
@@ -46,6 +46,8 @@ class LHC::Caching < LHC::Interceptor
|
|
46
46
|
data[:headers] = response.headers ? Hash[response.headers] : response.headers
|
47
47
|
# return_code is quite important as Typhoeus relies on it in order to determin 'success?'
|
48
48
|
data[:return_code] = response.options[:return_code]
|
49
|
+
# in a test scenario typhoeus uses mocks and not return_code to determine 'success?'
|
50
|
+
data[:mock] = response.mock
|
49
51
|
data
|
50
52
|
end
|
51
53
|
|
data/lib/lhc/response.rb
CHANGED
data/lib/lhc/version.rb
CHANGED
@@ -19,7 +19,8 @@ describe LHC::Caching do
|
|
19
19
|
body: 'The Website',
|
20
20
|
code: 200,
|
21
21
|
headers: nil,
|
22
|
-
return_code: nil
|
22
|
+
return_code: nil,
|
23
|
+
mock: :webmock
|
23
24
|
}, { expires_in: 5.minutes }
|
24
25
|
)
|
25
26
|
.and_call_original
|
@@ -28,6 +29,8 @@ describe LHC::Caching do
|
|
28
29
|
expect(original_response.body).to eq cached_response.body
|
29
30
|
expect(original_response.code).to eq cached_response.code
|
30
31
|
expect(original_response.headers).to eq cached_response.headers
|
32
|
+
expect(original_response.options[:return_code]).to eq cached_response.options[:return_code]
|
33
|
+
expect(original_response.mock).to eq cached_response.mock
|
31
34
|
assert_requested stub, times: 1
|
32
35
|
end
|
33
36
|
|