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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4f50c09248e6b6dc64b607d7f25632828172c77
4
- data.tar.gz: f35414d82ce6d8ad4bc746cee306b4ed8a86fc50
3
+ metadata.gz: 066ca2134edcffa0b160be6acf0d25ec6ba0a3f5
4
+ data.tar.gz: 84bf202646d1507ea4942ceca6006a028fbda820
5
5
  SHA512:
6
- metadata.gz: 99a1acc952727d0c179029f78045f798082235bbd9be5ca120db04863088f7cdcdb3e85faae7fa7b3fe56b473f910ee25cf5a3ab9915050efbfa0bad30a43e0f
7
- data.tar.gz: 1ddb7875449c6661848b34e52bf6dd5562ac0f931aeae712c68b8855dd7d468a3fa06a5024ce06bedbcc12a1b5af95afb10c744299bea921b47410da3f8c10ae
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
+
@@ -0,0 +1,11 @@
1
+ require 'straight_jacket/match'
2
+
3
+ module StraightJacket
4
+ module Matchers
5
+
6
+ def match(request)
7
+ StraightJacket::Match.new(request)
8
+ end
9
+
10
+ end
11
+ end
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.1
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-09-27 00:00:00.000000000 Z
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: []