add 'be_nil' matcher

This commit is contained in:
Laurent Sansonetti
2014-04-11 15:35:36 +02:00
parent b9219f0258
commit 32e547e48c

View File

@@ -84,6 +84,16 @@ class Object
end
end
def be_nil
lambda do |obj, res|
if (obj == nil) != res
puts "Expectation failed (expected `#{obj}' to be nil')"
$expectations_failures += 1
end
$expectations_total += 1
end
end
def mock(obj)
# XXX we probably should be smarter here.
obj