spec/integration_spec.rb in parallel_tests-0.6.0 vs spec/integration_spec.rb in parallel_tests-0.6.1
- old
+ new
@@ -1,6 +1,6 @@
-require 'spec/spec_helper'
+require 'spec_helper'
describe 'CLI' do
before do
`rm -rf #{folder}`
end
@@ -40,22 +40,24 @@
# test ran and gave their puts
result.should include('TEST1')
result.should include('TEST2')
# all results present
- result.scan('1 example, 0 failure').size.should == 4 # 2 results + 2 result summary
+ result.scan('1 example, 0 failure').size.should == 2 # 2 results
+ result.scan('2 examples, 0 failures').size.should == 1 # 1 summary
result.scan(/Finished in \d+\.\d+ seconds/).size.should == 2
result.scan(/Took \d+\.\d+ seconds/).size.should == 1 # parallel summary
$?.success?.should == true
end
it "fails when tests fail" do
write 'xxx_spec.rb', 'describe("it"){it("should"){puts "TEST1"}}'
write 'xxx2_spec.rb', 'describe("it"){it("should"){1.should == 2}}'
result = run_specs
- result.scan('1 example, 1 failure').size.should == 2
- result.scan('1 example, 0 failure').size.should == 2
+ result.scan('1 example, 1 failure').size.should == 1
+ result.scan('1 example, 0 failure').size.should == 1
+ result.scan('2 examples, 1 failure').size.should == 1
$?.success?.should == false
end
it "can exec given commands with ENV['TEST_ENV_NUM']" do
result = `#{executable} -e 'ruby -e "print ENV[:TEST_ENV_NUMBER.to_s].to_i"' -n 4`