lhc 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/lhc/concerns/lhc/basic_methods.rb +1 -1
- data/lib/lhc/version.rb +1 -1
- data/spec/interceptors/caching/hydra_spec.rb +24 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca22edb3d907f1f5eea91ae7d046f6853d8d44e6
|
4
|
+
data.tar.gz: 8384401b348e2be3abe4be92a613087002af0153
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3172e1a788c94cd7f1b04a0f22812abdf5e9373a0094bdec244d72af460c888aa073ce64958363a1ebc4506a88068d811ad4a65859519b64ff010158ce0ad16a
|
7
|
+
data.tar.gz: a5413bab8b96564f62a2c1c2c9af3ce861cdb5a419bef0f286223e286d86a7859ba5c0993cad1b91131f6e1da33fd542ecca5990012b0cf06a43778544924e77
|
data/.gitignore
CHANGED
data/lib/lhc/version.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe LHC::Caching do
|
4
|
+
before(:each) do
|
5
|
+
LHC.config.interceptors = [LHC::Caching]
|
6
|
+
LHC::Caching.cache = Rails.cache
|
7
|
+
Rails.cache.clear
|
8
|
+
end
|
9
|
+
|
10
|
+
let!(:first_request) do
|
11
|
+
stub_request(:get, "http://local.ch/").to_return(body: 'Website')
|
12
|
+
end
|
13
|
+
|
14
|
+
let!(:second_request) do
|
15
|
+
stub_request(:get, "http://local.ch/weather").to_return(body: 'The weather')
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'does not fetch requests served from cache when doing requests in parallel with hydra' do
|
19
|
+
LHC.request([{ url: 'http://local.ch', cache: true }, { url: 'http://local.ch/weather', cache: true }])
|
20
|
+
LHC.request([{ url: 'http://local.ch', cache: true }, { url: 'http://local.ch/weather', cache: true }])
|
21
|
+
assert_requested first_request, times: 1
|
22
|
+
assert_requested second_request, times: 1
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhc/contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -259,6 +259,7 @@ files:
|
|
259
259
|
- spec/interceptors/auth/bearer_spec.rb
|
260
260
|
- spec/interceptors/before_request_spec.rb
|
261
261
|
- spec/interceptors/before_response_spec.rb
|
262
|
+
- spec/interceptors/caching/hydra_spec.rb
|
262
263
|
- spec/interceptors/caching/main_spec.rb
|
263
264
|
- spec/interceptors/caching/methods_spec.rb
|
264
265
|
- spec/interceptors/caching/parameters_spec.rb
|
@@ -384,6 +385,7 @@ test_files:
|
|
384
385
|
- spec/interceptors/auth/bearer_spec.rb
|
385
386
|
- spec/interceptors/before_request_spec.rb
|
386
387
|
- spec/interceptors/before_response_spec.rb
|
388
|
+
- spec/interceptors/caching/hydra_spec.rb
|
387
389
|
- spec/interceptors/caching/main_spec.rb
|
388
390
|
- spec/interceptors/caching/methods_spec.rb
|
389
391
|
- spec/interceptors/caching/parameters_spec.rb
|