lib/minitest/matchers.rb in mongoid-minitest-0.0.1 vs lib/minitest/matchers.rb in mongoid-minitest-0.0.2
- old
+ new
@@ -1,24 +1,24 @@
module MiniTest
module Assertions
def assert_must(subject, matcher, msg = nil)
msg = message(msg) do
if matcher.respond_to? :failure_message
- matcher.failure_message
+ "Expected #{matcher.failure_message}".squeeze(" ")
else
- "Expected #{subject.inspect} to #{matcher.description}"
+ "Expected #{subject.inspect} to #{matcher.description}".squeeze(" ")
end
end
assert matcher.matches?(subject), msg
end
def assert_wont(subject, matcher, msg = nil)
msg = message(msg) do
if matcher.respond_to? :negative_failure_message
- matcher.negative_failure_message
+ "Expected #{matcher.negative_failure_message}".squeeze(" ")
else
- "Expected not to #{matcher.description}"
+ "Expected not to #{matcher.description}".squeeze(" ")
end
end
refute matcher.matches?(subject), msg
end