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: f2ce43cdeb1c391d2f2b81ebbe646bab845cae94
4
- data.tar.gz: b4ab6318f46cc2ea75b0d0ebe767804babe27075
3
+ metadata.gz: e0fde445aaa4f9daa0722ed7b86865670c70128f
4
+ data.tar.gz: b1115f8d198edb3e65d66d00b222df920954f2c1
5
5
  SHA512:
6
- metadata.gz: 81713512c7970b84015e1bc4e3b473baab7616e947f81183cd1c32532a623d575ff71faa2d72992c2721f7c3355b61097e5675cbbee2dbeeba32585c922bd004
7
- data.tar.gz: a4ba86f473787d058eb036a5f8657e1c8236be6deb34176801f277a6d8cf40972512c52e6489ef13ce59d42693665d16f04a9fb6519b2b9d84b82310676873b4
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
 
@@ -41,6 +41,10 @@ class LHC::Response
41
41
  raw.options
42
42
  end
43
43
 
44
+ def mock
45
+ raw.mock
46
+ end
47
+
44
48
  # Provides response time in ms.
45
49
  def time
46
50
  (raw.time || 0) * 1000
@@ -1,3 +1,3 @@
1
1
  module LHC
2
- VERSION ||= "5.0.0"
2
+ VERSION ||= "5.0.1"
3
3
  end
@@ -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
 
@@ -27,7 +27,8 @@ describe LHC::Caching do
27
27
  body: 'The Website',
28
28
  code: 200,
29
29
  headers: nil,
30
- return_code: nil
30
+ return_code: nil,
31
+ mock: :webmock
31
32
  }, { expires_in: 5.minutes }
32
33
  )
33
34
  .and_call_original
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhc
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/local-ch/lhc/contributors