summary refs log tree commit diff
diff options
context:
space:
mode:
authorYossef Mendelssohn <ymendel@pobox.com>2008-10-24 17:14:30 -0500
committerYossef Mendelssohn <ymendel@pobox.com>2008-10-24 17:16:36 -0500
commit6c8e263c5edfc3627dc004a1c26b19be6a25ca6b (patch)
treed53a8e2d79828b84911d5c125223193b571da5f5
parent172dd9c98e6d0058a928fe2c95d92de7993d1fb1 (diff)
downloadbacon-6c8e263c5edfc3627dc004a1c26b19be6a25ca6b.tar.gz
bacon-6c8e263c5edfc3627dc004a1c26b19be6a25ca6b.tar.xz
bacon-6c8e263c5edfc3627dc004a1c26b19be6a25ca6b.zip
Cleaning up setting of nested before blocks
-rw-r--r--lib/bacon.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/bacon.rb b/lib/bacon.rb
index 26079e3..256cd0c 100644
--- a/lib/bacon.rb
+++ b/lib/bacon.rb
@@ -257,11 +257,8 @@ end
 module Kernel
   private
   def describe(*args, &block)
-    befores = instance_variable_get('@before') || []
     context = Bacon::Context.new(args.join(' '), &block)
-    befores.each do |b|
-      context.before &b
-    end
+    (instance_variable_get('@before') || []).each { |b|  context.before &b }
     context.run
     context
   end