valuedate 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/valuedate.rb +1 -0
- data/test/test_valuedate.rb +6 -0
- data/valuedate.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/valuedate.rb
CHANGED
@@ -129,3 +129,4 @@ end
|
|
129
129
|
Valuedate.matcher(:in) { |value, expected| expected.include?(value) }
|
130
130
|
Valuedate.matcher(:is) { |*value, &block| block.call(*value) }
|
131
131
|
Valuedate.matcher(:not) { |*value, &block| !block.call(*value) }
|
132
|
+
Valuedate.matcher(:matches) { |value, expected| expected.match(value.to_s) }
|
data/test/test_valuedate.rb
CHANGED
@@ -196,6 +196,12 @@ context "Valuedate" do
|
|
196
196
|
asserts("invalid array size") { !v([1,2]) { value.not { |value| value.size == 2 } } }
|
197
197
|
end
|
198
198
|
|
199
|
+
context "matches" do
|
200
|
+
asserts("valid Regexp") { v("test me") { value.matches(%r{^test}) } }
|
201
|
+
asserts("invalid Regexp") { !v("fest me") { value.matches(%r{^test}) } }
|
202
|
+
asserts("invalid Fixnum") { !v(1) { value.matches(%r{^test}) } }
|
203
|
+
end
|
204
|
+
|
199
205
|
# TODO refactor!
|
200
206
|
context "errors" do
|
201
207
|
setup do
|
data/valuedate.gemspec
CHANGED