From b3e392c7830959557c098ac1b5ca85a0853f596d Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sat, 10 Jan 2009 14:01:30 -0800 Subject: Allow negated nontrue values outside specs --- lib/bacon.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bacon.rb b/lib/bacon.rb index f034fc7..3b71fd1 100644 --- a/lib/bacon.rb +++ b/lib/bacon.rb @@ -329,8 +329,10 @@ class Should if Bacon::Counter[:depth] > 0 Bacon::Counter[:requirements] += 1 raise Bacon::Error.new(:failed, description) unless @negated ^ r + r + else + @negated ? !r : !!r end - @negated ^ r ? r : false end def method_missing(name, *args, &block) -- cgit 1.4.1