From 32e547e48c7cc7d53e6a62029e8a1e967f8aced5 Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Fri, 11 Apr 2014 15:35:36 +0200 Subject: [PATCH] add 'be_nil' matcher --- test/test-android/app/main.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test-android/app/main.rb b/test/test-android/app/main.rb index 8f7fc2d2..34c19ad9 100644 --- a/test/test-android/app/main.rb +++ b/test/test-android/app/main.rb @@ -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