spec/integration_spec.rb in parallel_tests-0.16.3 vs spec/integration_spec.rb in parallel_tests-0.16.4

- old
+ new

@@ -302,9 +302,39 @@ 3 scenarios (2 failed, 1 passed) 3 steps (2 failed, 1 passed) """ end + + it "groups by scenario" do + write "features/long.feature", <<-EOS + Feature: xxx + Scenario: xxx + Given I print TEST_ENV_NUMBER + + Scenario: xxx + Given I print TEST_ENV_NUMBER + + Scenario Outline: xxx + Given I print TEST_ENV_NUMBER + + Examples: + | num | + | one | + | two | + EOS + result = run_tests "features", :type => "cucumber", :add => "--group-by scenarios" + result.should include("2 processes for 4 scenarios") + end + + it "groups by step" do + write "features/good1.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER" + write "features/good2.feature", "Feature: xxx\n Scenario: xxx\n Given I print TEST_ENV_NUMBER" + + result = run_tests "features", :type => "cucumber", :add => '--group-by steps' + + result.should include("2 processes for 2 features") + end end context "Spinach", :fails_on_ruby_187 => true do before do write "features/steps/a.rb", "class A < Spinach::FeatureSteps\n Given 'I print TEST_ENV_NUMBER' do\n puts \"YOUR TEST ENV IS \#{ENV['TEST_ENV_NUMBER']}!\"\n end\n And 'I sleep a bit' do\n sleep 0.2\n end\nend"