diff --git a/lib/cucumber/cli/options.rb b/lib/cucumber/cli/options.rb index 06a39ca8a5..14acd53b4b 100644 --- a/lib/cucumber/cli/options.rb +++ b/lib/cucumber/cli/options.rb @@ -375,6 +375,7 @@ def reverse_merge(other_options) @options[:source] &= other_options[:source] @options[:snippets] &= other_options[:snippets] @options[:strict] |= other_options[:strict] + @options[:dry_run] |= other_options[:dry_run] @profiles += other_options.profiles @expanded_args += other_options.expanded_args diff --git a/spec/cucumber/cli/configuration_spec.rb b/spec/cucumber/cli/configuration_spec.rb index 0e6845b8b4..a681898ee7 100644 --- a/spec/cucumber/cli/configuration_spec.rb +++ b/spec/cucumber/cli/configuration_spec.rb @@ -421,6 +421,12 @@ def reset_config config.dry_run?.should be_true end + it "returns true when --dry-run was specified in yaml file" do + given_cucumber_yml_defined_as({'default' => '--dry-run'}) + config.parse!([]) + config.dry_run?.should be_true + end + it "returns false by default" do config.parse!([]) config.dry_run?.should be_false