spec/specs/matches_spec.rb in fakes-0.3.2 vs spec/specs/matches_spec.rb in fakes-0.3.7
- old
+ new
@@ -15,9 +15,19 @@
match = Matches.in_range((1..10))
match.matches?(4).should be_true
match.matches?(10).should be_true
match.matches?(11).should be_false
end
+ it "should be able to create a nil matcher" do
+ match = Matches.nil
+ match.matches?(nil).should be_true
+ match.matches?(10).should be_false
+ end
+ it "should be able to create a not nil matcher" do
+ match = Matches.not_nil
+ match.matches?(10).should be_true
+ match.matches?(nil).should be_false
+ end
it "should be able to create a regex string matcher" do
match = Matches.regex(/a|e|i|o|u/)
match.matches?("awwef").should be_true
match.matches?("rwwgf").should be_false
end