tshield 0.11.1.0 → 0.11.2.0
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/lib/tshield/request_matching.rb +5 -1
- data/lib/tshield/version.rb +1 -1
- data/spec/tshield/request_matching_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1638a863b2fd6f3b6edacce9901af5d0dd37ffd65db2f940bc2e0e207d2f7ae
|
4
|
+
data.tar.gz: edd442212d894f3c481993559a5e6c94050a409035c602629bdc604f629d4d6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ccc7c8ffea46ca7a467374e37d399d58588c3e02acebe1e87ffdf007c75529ac0118a5655923f2caf4bf2fdb5777544c7832730725ef5eb6ee12e0b521f6134
|
7
|
+
data.tar.gz: d8bd3b1e229aa029808a04a7f7d4f42519a98d2896a1100f01abdd3a7a0cb733e22da0a9f8a8297df4233f9b3774592f8edb8bef81d29e14f4a3ec55ceba4f7f
|
@@ -33,7 +33,7 @@ module TShield
|
|
33
33
|
|
34
34
|
def find_stub
|
35
35
|
stubs = self.class.stubs
|
36
|
-
result = filter_stubs(stubs[@options[:session]])
|
36
|
+
result = filter_stubs(stubs[@options[:session]] || {})
|
37
37
|
return result if result
|
38
38
|
|
39
39
|
filter_stubs(stubs[DEFAULT_SESSION]) unless @options[:session] == DEFAULT_SESSION
|
@@ -59,6 +59,10 @@ module TShield
|
|
59
59
|
class << self
|
60
60
|
attr_reader :stubs
|
61
61
|
|
62
|
+
def clear_stubs
|
63
|
+
@stubs = nil
|
64
|
+
end
|
65
|
+
|
62
66
|
def load_stubs
|
63
67
|
@stubs = {}
|
64
68
|
Dir.glob('matching/**/*.json').each do |entry|
|
data/lib/tshield/version.rb
CHANGED
@@ -9,10 +9,23 @@ require 'tshield/response'
|
|
9
9
|
describe TShield::RequestMatching do
|
10
10
|
before :each do
|
11
11
|
@configuration = double
|
12
|
+
TShield::RequestMatching.clear_stubs
|
12
13
|
allow(TShield::Configuration)
|
13
14
|
.to receive(:singleton).and_return(@configuration)
|
14
15
|
end
|
15
16
|
|
17
|
+
context 'on empty matching path' do
|
18
|
+
before :each do
|
19
|
+
allow(Dir).to receive(:glob)
|
20
|
+
.and_return([])
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should return empty response when called' do
|
24
|
+
request_matching = TShield::RequestMatching.new('/')
|
25
|
+
expect(request_matching.match_request).to be_nil
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
16
29
|
context 'matching path' do
|
17
30
|
before :each do
|
18
31
|
allow(Dir).to receive(:glob)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tshield
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Rubin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|