spec/runner_spec.rb in bigbench-0.0.4 vs spec/runner_spec.rb in bigbench-0.0.5
- old
+ new
@@ -1,9 +1,13 @@
require_relative "./helpers"
describe BigBench::Runner do
+ before(:each) do
+ Dir.chdir File.dirname(__FILE__)
+ end
+
it "should raise an exception if no benchmarks were defined" do
lambda {BigBench.run!}.should raise_error(BigBench::Runner::NoBenchmarksDefined, "Sorry, I couldn't find any benchmarks!")
end
it "should run all benchmarks" do
@@ -23,18 +27,15 @@
BigBench.benchmarks.size.should == 2
BigBench.benchmarks.each{ |benchmark| benchmark.runs.should == 1 }
end
- it "should load an external test and warn about the missing config" do
- test = File.open("spec/tests/local_invalid.rb", "rb"){ |file| file.read }
- lambda{ BigBench.load_test!(test) }.should raise_error(BigBench::Configuration::InvalidOptions, "At least: #{BigBench::Configuration::Config::VALIDATE_OPTIONS.join(', ')} are required")
- end
-
it "should successfully load an external test" do
- test = File.open("spec/tests/local.rb", "rb"){ |file| file.read }
+ test = File.open("tests/local.rb", "rb"){ |file| file.read }
BigBench.load_test!(test)
+ BigBench.config.duration.should == 1.second
+ BigBench.duration.should == 1.second
BigBench.benchmarks.size.should == 2
end
end
\ No newline at end of file