spec/integration_spec.rb in parallel_tests-0.4.10 vs spec/integration_spec.rb in parallel_tests-0.4.11
- old
+ new
@@ -27,11 +27,11 @@
def executable
"#{bin_folder}/parallel_test"
end
def run_specs(options={})
- `cd #{folder} && #{executable} -t spec -n #{options[:processes]||2} #{options[:add]} 2>&1 && echo 'i ran!'`
+ `cd #{folder} && #{executable} -t spec -n #{options[:processes]||2} #{options[:add]} 2>&1`
end
it "runs tests in parallel" do
write 'xxx_spec.rb', 'describe("it"){it("should"){puts "TEST1"}}'
write 'xxx2_spec.rb', 'describe("it"){it("should"){puts "TEST2"}}'
@@ -43,22 +43,20 @@
# all results present
result.scan('1 example, 0 failure').size.should == 4 # 2 results + 2 result summary
result.scan(/Finished in \d+\.\d+ seconds/).size.should == 2
result.scan(/Took \d+\.\d+ seconds/).size.should == 1 # parallel summary
-
- result.should include('i ran!')
+ $?.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.should =~ /specs failed/i
- result.should_not include('i ran!')
+ $?.success?.should == false
end
it "can exec given commands with ENV['TEST_ENV_NUM']" do
result = `#{executable} -e 'ruby -e "puts ENV[:TEST_ENV_NUMBER.to_s].inspect"' -n 4`
result.split("\n").sort.should == %w["" "2" "3" "4"]
\ No newline at end of file