webspicy 0.20.1 → 0.20.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webspicy/specification/oldies/bridge.rb +4 -1
- data/lib/webspicy/specification/service.rb +3 -0
- data/lib/webspicy/specification/test_case.rb +3 -0
- data/lib/webspicy/tester.rb +6 -1
- data/lib/webspicy/tester/assertions.rb +2 -2
- data/lib/webspicy/tester/result.rb +2 -2
- data/lib/webspicy/version.rb +1 -1
- data/lib/webspicy/web/invocation.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0039cf2e5ebbb990cc29c6ed76e4eabf941feeb031f4761d30e120f32e31a41f'
|
4
|
+
data.tar.gz: c743e9f1650e7d9a09bef50d54e2e35e261761b085456d4bd8b4f7a6060f5304
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a039f3919a201378847ab7db291dcd72a345d594d11900e941f65c6c9e211825851778c4dea9969c2dc1ed88d80ae177af03f977e9437eba15471acd111127
|
7
|
+
data.tar.gz: 61347ee21583f15bb966e279221604fe6b7f89c2a2833bc7dfa92d062ff238b2f26949b89674c97eb651d09d435610d5bf5689bf8596b4ed75a6ea4e4a1a981c
|
@@ -10,11 +10,14 @@ module Webspicy
|
|
10
10
|
attr_reader :target
|
11
11
|
|
12
12
|
def instrument
|
13
|
+
return unless target.respond_to?(:instrument)
|
13
14
|
target.instrument(test_case, client)
|
14
15
|
end
|
15
16
|
|
16
17
|
def check!
|
17
|
-
target.check
|
18
|
+
return unless target.respond_to?(:check)
|
19
|
+
res = target.check(invocation)
|
20
|
+
res ? fail!(res) : nil
|
18
21
|
end
|
19
22
|
|
20
23
|
def to_s
|
data/lib/webspicy/tester.rb
CHANGED
@@ -61,6 +61,11 @@ module Webspicy
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
+
def bind_condition(c)
|
65
|
+
c = Specification::Oldies::Bridge.new(c) unless c.respond_to?(:bind)
|
66
|
+
c.bind(self)
|
67
|
+
end
|
68
|
+
|
64
69
|
protected
|
65
70
|
|
66
71
|
def run_config
|
@@ -176,7 +181,7 @@ module Webspicy
|
|
176
181
|
end
|
177
182
|
|
178
183
|
def instrument_one(condition)
|
179
|
-
condition
|
184
|
+
bind_condition(condition).instrument
|
180
185
|
rescue ArgumentError
|
181
186
|
raise "#{condition.class} implements old PRE/POST contract"
|
182
187
|
end
|
@@ -40,7 +40,7 @@ module Webspicy
|
|
40
40
|
actual_size(target, path) == expected
|
41
41
|
end
|
42
42
|
|
43
|
-
def actual_size(target, path)
|
43
|
+
def actual_size(target, path)
|
44
44
|
target = extract_path(target, path)
|
45
45
|
respond_to!(target, :size).size
|
46
46
|
end
|
@@ -68,7 +68,7 @@ module Webspicy
|
|
68
68
|
an_array(target).find { |t| t[:id] == id }
|
69
69
|
end
|
70
70
|
|
71
|
-
def idFD(element, expected)
|
71
|
+
def idFD(element, expected)
|
72
72
|
expected.keys.all? do |k|
|
73
73
|
value_equal(expected[k], element[k])
|
74
74
|
end
|
@@ -96,13 +96,13 @@ module Webspicy
|
|
96
96
|
|
97
97
|
def check_postconditions!
|
98
98
|
service.postconditions.each do |c|
|
99
|
-
check_one! Result::PostconditionMet.new(self,
|
99
|
+
check_one! Result::PostconditionMet.new(self, tester.bind_condition(c))
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
103
|
def check_errconditions!
|
104
104
|
service.errconditions.each do |c|
|
105
|
-
check_one! Result::ErrconditionMet.new(self,
|
105
|
+
check_one! Result::ErrconditionMet.new(self, tester.bind_condition(c))
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
data/lib/webspicy/version.rb
CHANGED