summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2012-03-16 19:05:34 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2012-03-16 19:15:11 +0100
commitce75f62a7c11b6f8c57baae8650f36322920f9d6 (patch)
tree874c45630a92e01e95806de57e1d73087a41ac3e
parent2d0ff135846363e2baf00d43049b4e9fc4e70c47 (diff)
downloadbacon-ce75f62a7c11b6f8c57baae8650f36322920f9d6.tar.gz
bacon-ce75f62a7c11b6f8c57baae8650f36322920f9d6.tar.xz
bacon-ce75f62a7c11b6f8c57baae8650f36322920f9d6.zip
Remove passing arguments in #satisfy, simplify argument parsing
This feature was never used and triggers a JRuby bug:
http://jira.codehaus.org/browse/JRUBY-6550

Proposed by Gabriel Horner <gabriel.horner@gmail.com>.
-rw-r--r--lib/bacon.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/bacon.rb b/lib/bacon.rb
index abd52c1..2275047 100644
--- a/lib/bacon.rb
+++ b/lib/bacon.rb
@@ -319,14 +319,8 @@ class Should
   alias a  be
   alias an be
 
-  def satisfy(*args, &block)
-    if args.size == 1 && String === args.first
-      description = args.shift
-    else
-      description = ""
-    end
-
-    r = yield(@object, *args)
+  def satisfy(description="", &block)
+    r = yield(@object)
     if Bacon::Counter[:depth] > 0
       Bacon::Counter[:requirements] += 1
       raise Bacon::Error.new(:failed, description)  unless @negated ^ r