webspicy 0.8.4 → 0.8.5

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: d4beb76e573d7d42f8a85e65608ad59c83038a63
4
- data.tar.gz: d1c2cb823fa50d41573b3a9116bc5125ef5fc98c
3
+ metadata.gz: 836e946a0ffd8e44c677efe44086bcbbe909de31
4
+ data.tar.gz: a3dc671cac147fe93c5dc96ea6fa48277b73daf0
5
5
  SHA512:
6
- metadata.gz: 73bf0132edf5214d7c0209202987f87e837765f68ff1916fc60e2924e2e4e620825100bf4347b5393d6b348b1bf475905f23e38ccd0fb9a3f79894adf08ed8f2
7
- data.tar.gz: cd4f8964ccae0a8979a6610dac9aa972f00243f8f421017f536aba75fdba037947d3fca97b8f653a4543554bd8859eae0f2dbef88dbf92ad6ecf6e7d16893f05
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.3)
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.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.0)
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.0)
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.4)
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.14.6
77
+ 1.16.0
@@ -36,6 +36,8 @@ services:
36
36
  status: 200
37
37
  assert:
38
38
  - "pathFD('', id: 1)"
39
+ - "match('description', /Refactor/)"
40
+ - "notMatch('description', /Foo/)"
39
41
 
40
42
  counterexamples:
41
43
 
@@ -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)
@@ -2,7 +2,7 @@ module Webspicy
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
- TINY = 4
5
+ TINY = 5
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webspicy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau