Skip to content

Commit

Permalink
remove duration from dry-run results
Browse files Browse the repository at this point in the history
  • Loading branch information
richarda committed Apr 1, 2015
1 parent f9bd7c1 commit 921084a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
3 changes: 0 additions & 3 deletions features/docs/cli/dry_run.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Feature: Dry Run
1 scenario (1 skipped)
1 step (1 skipped)
0m0.012s
"""

Expand All @@ -45,7 +44,6 @@ Feature: Dry Run
1 scenario (1 skipped)
1 step (1 skipped)
0m0.012s
"""

Expand All @@ -68,6 +66,5 @@ Feature: Dry Run
1 scenario (1 undefined)
1 step (1 undefined)
0m0.012s
"""
14 changes: 6 additions & 8 deletions features/docs/formatters/usage_formatter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Feature: Usage formatter
Then it should pass with exactly:
"""
--------
/A/ # features/step_definitions/steps.rb:1
Given A # features/f.feature:3
Given A # features/f.feature:12
Expand All @@ -50,7 +50,7 @@ Feature: Usage formatter
Given C # features/f.feature:15
/D/ # features/step_definitions/steps.rb:4
NOT MATCHED BY ANY STEPS
4 scenarios (4 skipped)
11 steps (11 skipped)
0m0.012s
Expand All @@ -62,7 +62,7 @@ Feature: Usage formatter
Then it should pass with exactly:
"""
----------
/A/ # features/step_definitions/steps.rb:1
Given A # features/f.feature:3
Given A # features/f.feature:12
Expand All @@ -76,10 +76,9 @@ Feature: Usage formatter
Given C # features/f.feature:15
/D/ # features/step_definitions/steps.rb:4
NOT MATCHED BY ANY STEPS
4 scenarios (4 skipped)
11 steps (11 skipped)
0m0.012s
"""

Expand All @@ -88,15 +87,14 @@ Feature: Usage formatter
Then it should pass with exactly:
"""
--------
/A/ # features/step_definitions/steps.rb:1
/B/ # features/step_definitions/steps.rb:2
/C/ # features/step_definitions/steps.rb:3
/D/ # features/step_definitions/steps.rb:4
NOT MATCHED BY ANY STEPS
4 scenarios (4 skipped)
11 steps (11 skipped)
0m0.012s
"""
1 change: 1 addition & 0 deletions lib/cucumber/cli/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def parse!(args)
opts.on("-d", "--dry-run", "Invokes formatters without executing the steps.",
"This also omits the loading of your support/env.rb file if it exists.") do
@options[:dry_run] = true
@options[:duration] = false
end
opts.on("-m", "--no-multiline",
"Don't print multiline strings and tables under steps.") do
Expand Down
7 changes: 7 additions & 0 deletions spec/cucumber/cli/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,13 @@ def after_parsing(args)

expect(options[:snippets]).to be false
end

it "sets duration to false" do
given_cucumber_yml_defined_as({'foo' => %w[--dry-run]})
options.parse!(%w{--dry-run})

expect(options[:duration]).to be false
end
end
end
end
Expand Down

0 comments on commit 921084a

Please sign in to comment.