From 6c8e263c5edfc3627dc004a1c26b19be6a25ca6b Mon Sep 17 00:00:00 2001 From: Yossef Mendelssohn Date: Fri, 24 Oct 2008 17:14:30 -0500 Subject: Cleaning up setting of nested before blocks --- lib/bacon.rb | 5 +---- 1 file changed, 1 insertion(+), 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 -- cgit 1.4.1