valuedate 0.0.5 → 0.0.6

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -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) }
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{valuedate}
8
- s.version = "0.0.5"
8
+ s.version = "0.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Peter Suschlik"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valuedate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Suschlik