mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 09:31:20 +08:00
add 'be_nil' matcher
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user