Skip to content

Commit

Permalink
Often can depend on default implementation of #do_match
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyhaines committed Jul 1, 2012
1 parent 70303b5 commit c56103c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/ramcrest/aint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(expected)
end

def do_match(expected, actual)
expected.matches?(actual).negate!
super.negate!
end

def mismatch_message(actual, match)
Expand Down
2 changes: 1 addition & 1 deletion lib/ramcrest/has_size.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(expected)
end

def do_match(expected, actual)
expected.matches?(actual.size)
super expected, actual.size
end

def mismatch_message(actual, match)
Expand Down
4 changes: 0 additions & 4 deletions lib/ramcrest/is.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ def initialize(expected)
@expected = expected
end

def do_match(expected, actual)
expected.matches?(actual)
end

def mismatch_message(actual, match)
"was <#{match.description}>"
end
Expand Down
4 changes: 4 additions & 0 deletions lib/ramcrest/match.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module Ramcrest
module Match

def do_match(expected, actual)
expected.matches?(actual)
end

def matches?(actual)
match = do_match(@expected, actual)
if match.matched?
Expand Down

0 comments on commit c56103c

Please sign in to comment.