Permalink
Browse files

alias will, will_not and wont

Signed-off-by: Jeremy McAnally <jeremymcanally@gmail.com>
  • Loading branch information...
1 parent 5d9e63c commit c1d80067f36d801cd5aa993c636e1ebaa269a6fd @mattly mattly committed with Jan 26, 2009
Showing with 17 additions and 0 deletions.
  1. +5 −0 lib/matchy/modals.rb
  2. +12 −0 test/test_modals.rb
@@ -16,6 +16,8 @@ def should(expectation = nil)
end
end
+ alias :will :should
+
# Tests that an expectation doesn't match the given object.
#
# ==== Examples
@@ -32,6 +34,9 @@ def should_not(expectation = nil)
end
end
+ alias :will_not :should_not
+ alias :wont :should_not
+
protected
def match_expectation(expectation, match)
if expectation.matches?(self) != match
View
@@ -10,10 +10,22 @@ def test_should
3.should(@expectation)
end
+ def test_will
+ 3.will(@expectation)
+ end
+
def test_should_not
3.should_not(@bad_expectation)
end
+ def test_will_not
+ 3.will_not(@bad_expectation)
+ end
+
+ def test_wont
+ 3.wont(@bad_expectation)
+ end
+
def test_should_operator_expectation_returned
obj = 3.should
assert_equal Matchy::Expectations::OperatorExpectation, obj.class

0 comments on commit c1d8006

Please sign in to comment.