From 5107be14c26c276ffc593b36feef71cd2140cead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Fri, 25 Oct 2013 13:47:01 +0200 Subject: [PATCH] [spec] Don't set output type unti very last moment. --- lib/motion/spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/motion/spec.rb b/lib/motion/spec.rb index 23e45c0b..1396d49a 100644 --- a/lib/motion/spec.rb +++ b/lib/motion/spec.rb @@ -275,7 +275,6 @@ module Bacon 'rubymine' => RubyMineOutput, 'colorized' => ColorizedOutput, } - extend(Outputs[ENV['output']] || SpecDoxOutput) class Error < RuntimeError attr_accessor :count_as @@ -476,6 +475,10 @@ module Bacon end def self.run + unless respond_to?(:handle_specification_begin) + extend(Outputs[ENV['output']] || SpecDoxOutput) + end + @timer ||= Time.now Counter[:context_depth] += 1 handle_specification_begin(current_context.name) @@ -513,6 +516,7 @@ module Bacon def run # TODO #return unless name =~ RestrictContext + if spec = current_specification spec.performSelector("run", withObject:nil, afterDelay:0) else