spec/post_processors/graphs_spec.rb in bigbench-0.0.4 vs spec/post_processors/graphs_spec.rb in bigbench-0.0.5
- old
+ new
@@ -1,23 +1,28 @@
require_relative "../helpers"
require_relative "../../lib/bigbench/post_processor/graphs"
describe BigBench::PostProcessor::Graphs do
+ before(:each) do
+ Dir.chdir File.dirname(__FILE__)
+ Dir.chdir ".."
+ end
+
it "should run and create the following graphs" do
- folder = "spec/tmp/graphs_#{Time.now.to_i}"
+ folder = "tmp/graphs_#{Time.now.to_i}"
BigBench.config.duration = 2.minutes
- BigBench.config.output = "spec/tests/sample_results_big.ljson"
+ BigBench.config.output = "tests/sample_results_big.ljson"
BigBench.benchmark("index page" => "http://localhost:3001"){ get "/" }
BigBench.post_process :graphs, :folder => folder
BigBench.benchmarks.should have(1).benchmark
BigBench.post_processors.should have(1).processor
lambda{ BigBench.post_processors.first.run! }.should_not raise_exception
Dir["#{folder}/*.png"].size.should == 18
- Dir["spec/tmp/*"].each{ |folder| FileUtils.rm_rf(folder) }
+ Dir["tmp/*"].each{ |folder| FileUtils.rm_rf(folder) }
end
end
\ No newline at end of file