straight-jacket 0.0.1 → 0.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/lib/straight_jacket/match.rb +32 -0
- data/lib/straight_jacket/matchers.rb +11 -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: 066ca2134edcffa0b160be6acf0d25ec6ba0a3f5
|
4
|
+
data.tar.gz: 84bf202646d1507ea4942ceca6006a028fbda820
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb5c15c88b03f4c3f1b2c928e745f574f5404cae1a7812688b1be029ba9d8e678292d03db1be4f563f6c95cab8ac3d5381b63bc496e8f5048e7f36ef0be37ad3
|
7
|
+
data.tar.gz: f90846c7085c43d2f639ae1f4b2c4512d0d0301fa3aed1bd7a9bbd6855f562987971f72c8d497000e420f7f3e52f5b9591738225f46424ad246dccbc3c9219f4
|
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
module StraightJacket
|
3
|
+
class Match
|
4
|
+
|
5
|
+
def initialize(request)
|
6
|
+
@request = request
|
7
|
+
end
|
8
|
+
|
9
|
+
def matches?(constrainer)
|
10
|
+
@actual = constrainer
|
11
|
+
constrainer.matches?(request)
|
12
|
+
end
|
13
|
+
|
14
|
+
def failure_message_for_should
|
15
|
+
"expected #{actual} to match #{request.parameters} but did not"
|
16
|
+
end
|
17
|
+
|
18
|
+
def failure_message_for_should_not
|
19
|
+
"expected #{actual} not to match #{request.parameters} but did"
|
20
|
+
end
|
21
|
+
|
22
|
+
def description
|
23
|
+
"match parameters #{request.parameters}"
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
attr_reader :request, :actual
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: straight-jacket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Myles Megyesi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -89,12 +89,14 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- lib/straight_jacket/equals.rb
|
91
91
|
- lib/straight_jacket/integer_parameter.rb
|
92
|
+
- lib/straight_jacket/matchers.rb
|
92
93
|
- lib/straight_jacket/required_parameter.rb
|
93
94
|
- lib/straight_jacket/inclusion.rb
|
94
95
|
- lib/straight_jacket/format.rb
|
95
96
|
- lib/straight_jacket/composite.rb
|
96
97
|
- lib/straight_jacket/collection.rb
|
97
98
|
- lib/straight_jacket/validator.rb
|
99
|
+
- lib/straight_jacket/match.rb
|
98
100
|
- lib/straight_jacket.rb
|
99
101
|
homepage:
|
100
102
|
licenses: []
|