From e101321c587f3e17b4b391ea927874f0854c0dce Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 18 Apr 2012 17:02:23 -0400 Subject: [PATCH] have the option for running code after step writer completes --- lib/flowerbox/reporter/base.rb | 1 + lib/flowerbox/reporter/step_writer.rb | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/flowerbox/reporter/base.rb b/lib/flowerbox/reporter/base.rb index 31b3337..2876e8a 100644 --- a/lib/flowerbox/reporter/base.rb +++ b/lib/flowerbox/reporter/base.rb @@ -47,6 +47,7 @@ module Flowerbox end def post_report_failed(data) ; end + def report_numeric_results(gathered_results, data = {}) ; end def start(message) ; end diff --git a/lib/flowerbox/reporter/step_writer.rb b/lib/flowerbox/reporter/step_writer.rb index bca56b6..92615ad 100644 --- a/lib/flowerbox/reporter/step_writer.rb +++ b/lib/flowerbox/reporter/step_writer.rb @@ -13,6 +13,14 @@ module Flowerbox::Reporter self.puts "Writing #{target}..." File.open(target, 'wb') { |fh| fh.print result.test_environment.obtain_test_definition_for(result) } + + post_report_data[:undefined] = true + end + end + + def post_report_undefined(data) + if post_report_data[:undefined] && options[:on_finish] + options[:on_finish].call(options[:target]) end end end