webspicy 0.8.4 → 0.8.5
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/examples/restful/Gemfile.lock +6 -6
- data/examples/restful/webspicy/todo/getTodo.yml +2 -0
- data/lib/webspicy/tester/asserter.rb +14 -0
- data/lib/webspicy/tester/assertions.rb +9 -0
- data/lib/webspicy/version.rb +1 -1
- data/spec/unit/tester/test_assertions.rb +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 836e946a0ffd8e44c677efe44086bcbbe909de31
|
4
|
+
data.tar.gz: a3dc671cac147fe93c5dc96ea6fa48277b73daf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d09bdac92594edde6b3bdd4780227b4d828ad7fdc97ed9d524e7ca946a59862a281936eeb1a09655497a623c11e5d2d0af00fceff8dc9aa0d5c51ef6e275c2c
|
7
|
+
data.tar.gz: 04f024771146712bf45d7bea8f6e02a818d038233115e7a467b420252e37c0a12a87134e853b7c1f0dca2b69e6c4e1230c2f94126d5e18bd7b94f988ee737268
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../..
|
3
3
|
specs:
|
4
|
-
webspicy (0.8.
|
4
|
+
webspicy (0.8.4)
|
5
5
|
finitio (~> 0.5.2)
|
6
6
|
http (~> 2)
|
7
7
|
path (~> 1.3)
|
@@ -31,7 +31,7 @@ GEM
|
|
31
31
|
http_parser.rb (0.6.0)
|
32
32
|
mustermann (1.0.0)
|
33
33
|
path (1.3.3)
|
34
|
-
public_suffix (3.0.
|
34
|
+
public_suffix (3.0.2)
|
35
35
|
rack (2.0.3)
|
36
36
|
rack-protection (2.0.0)
|
37
37
|
rack
|
@@ -43,7 +43,7 @@ GEM
|
|
43
43
|
rspec-core (~> 3.7.0)
|
44
44
|
rspec-expectations (~> 3.7.0)
|
45
45
|
rspec-mocks (~> 3.7.0)
|
46
|
-
rspec-core (3.7.
|
46
|
+
rspec-core (3.7.1)
|
47
47
|
rspec-support (~> 3.7.0)
|
48
48
|
rspec-expectations (3.7.0)
|
49
49
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -51,7 +51,7 @@ GEM
|
|
51
51
|
rspec-mocks (3.7.0)
|
52
52
|
diff-lcs (>= 1.2.0, < 2.0)
|
53
53
|
rspec-support (~> 3.7.0)
|
54
|
-
rspec-support (3.7.
|
54
|
+
rspec-support (3.7.1)
|
55
55
|
sinatra (2.0.0)
|
56
56
|
mustermann (~> 1.0)
|
57
57
|
rack (~> 2.0)
|
@@ -60,7 +60,7 @@ GEM
|
|
60
60
|
tilt (2.0.7)
|
61
61
|
unf (0.1.4)
|
62
62
|
unf_ext
|
63
|
-
unf_ext (0.0.7.
|
63
|
+
unf_ext (0.0.7.5)
|
64
64
|
|
65
65
|
PLATFORMS
|
66
66
|
ruby
|
@@ -74,4 +74,4 @@ DEPENDENCIES
|
|
74
74
|
webspicy!
|
75
75
|
|
76
76
|
BUNDLED WITH
|
77
|
-
1.
|
77
|
+
1.16.0
|
@@ -74,6 +74,20 @@ module Webspicy
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
+
def match(path, expected = NO_ARG)
|
78
|
+
path, expected = '', path if expected == NO_ARG
|
79
|
+
unless @assertions.match(@target, path, expected)
|
80
|
+
_! "Expected #{_s(@target)} to match #{expected.inspect}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def notMatch(path, expected = NO_ARG)
|
85
|
+
path, expected = '', path if expected == NO_ARG
|
86
|
+
unless @assertions.notMatch(@target, path, expected)
|
87
|
+
_! "Expected #{_s(@target)} not to match #{expected.inspect}"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
77
91
|
private
|
78
92
|
|
79
93
|
def DateTime(str)
|
@@ -68,6 +68,15 @@ module Webspicy
|
|
68
68
|
}
|
69
69
|
end
|
70
70
|
|
71
|
+
def match(target, path, rx)
|
72
|
+
target = extract_path(target, path)
|
73
|
+
!(target.to_s =~ rx).nil?
|
74
|
+
end
|
75
|
+
|
76
|
+
def notMatch(target, path, rx)
|
77
|
+
!match(target, path, rx)
|
78
|
+
end
|
79
|
+
|
71
80
|
private
|
72
81
|
|
73
82
|
def extract_path(target, path = NO_ARG)
|
data/lib/webspicy/version.rb
CHANGED
@@ -103,6 +103,18 @@ module Webspicy
|
|
103
103
|
expect(pathFD(target, 'foo', boz: "biz")).to be(false)
|
104
104
|
end
|
105
105
|
|
106
|
+
it 'has a match assertion' do
|
107
|
+
target = "hello world"
|
108
|
+
expect(match(target, '', /world/)).to be(true)
|
109
|
+
expect(match(target, '', /foobar/)).to be(false)
|
110
|
+
end
|
111
|
+
|
112
|
+
it 'has a notMatch assertion' do
|
113
|
+
target = "hello world"
|
114
|
+
expect(notMatch(target, '', /world/)).to be(false)
|
115
|
+
expect(notMatch(target, '', /foobar/)).to be(true)
|
116
|
+
end
|
117
|
+
|
106
118
|
end
|
107
119
|
end # class Tester
|
108
120
|
end # module Webspicy
|