require_relative "../helpers" require_relative "../../lib/bigbench/post_processor/graphs" describe BigBench::PostProcessor::Graphs do it "should run and create the following graphs" do folder = "spec/tmp/graphs_#{Time.now.to_i}" BigBench.config.duration = 2.minutes BigBench.config.output = "spec/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) } end end