spec/executor_spec.rb in bigbench-0.0.3 vs spec/executor_spec.rb in bigbench-0.0.4
- old
+ new
@@ -75,6 +75,41 @@
BigBench.benchmarks.size.should == 0
BigBench::Store.test.should be_nil
end
+ it "should re-run the post processors from a receipt" do
+
+ argv = ["run", "postprocessors", "spec/tests/with_post_processor.rb"]
+ BigBench::Executor.run!(argv)
+
+ BigBench.benchmarks.size.should == 1
+ BigBench.benchmarks.each{ |benchmark| benchmark.runs.should == 0 }
+
+ File.exist?(BigBench.config.output).should be_true
+ File.open(BigBench.config.output) do |file|
+ file.each_line{ |json| JSON.parse(json).is_a?(Hash).should be_true }
+ end
+
+ BigBench.post_processors.each{ |processor| processor.runs.should == 1 }
+
+ end
+
+ it "should run a single post processor for a single test" do
+
+ argv = ["run", "postprocessor", "spec/tests/with_post_processor.rb", "statistics"]
+ BigBench::Executor.run!(argv)
+
+ BigBench.benchmarks.size.should == 1
+ BigBench.benchmarks.each{ |benchmark| benchmark.runs.should == 0 }
+
+ File.exist?(BigBench.config.output).should be_true
+ File.open(BigBench.config.output) do |file|
+ file.each_line{ |json| JSON.parse(json).is_a?(Hash).should be_true }
+ end
+
+ BigBench.post_processors.size.should == 1
+ BigBench.post_processors.first.runs.should == 1
+
+ end
+
end
\ No newline at end of file