summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/bacon.rb4
-rw-r--r--test/spec_bacon.rb10
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/bacon.rb b/lib/bacon.rb
index 8d5e099..045a910 100644
--- a/lib/bacon.rb
+++ b/lib/bacon.rb
@@ -218,8 +218,8 @@ module Bacon
     def describe(*args, &block)
       context = Bacon::Context.new(args.join(' '), &block)
       (parent_context = self).methods(false).each {|e|
-        (class << context; self; end).send(:define_method, e) { |*args2|
-          parent_context.send(e, *args2)
+        (class << context; self; end).send(:define_method, e) { |*args2, &block2|
+          parent_context.send(e, *args2, &block2)
         }
       }
       @before.each { |b| context.before(&b) }
diff --git a/test/spec_bacon.rb b/test/spec_bacon.rb
index 2d1ceef..e3e288e 100644
--- a/test/spec_bacon.rb
+++ b/test/spec_bacon.rb
@@ -375,6 +375,10 @@ describe "Methods" do
     42
   end
 
+  def the_towels
+    yield "DON'T PANIC"
+  end
+
   it "should be accessible in a test" do
     the_meaning_of_life.should == 42
   end
@@ -383,6 +387,12 @@ describe "Methods" do
     it "should be accessible in a test" do
       the_meaning_of_life.should == 42
     end
+
+    it "should pass the block" do
+      the_towels do |label|
+        label.should == "DON'T PANIC"
+      end.should == true
+    end
   end
 end