spec/cucumber/cli/options_spec.rb in cucumber-0.8.7 vs spec/cucumber/cli/options_spec.rb in cucumber-0.9.0
- old
+ new
@@ -1,7 +1,8 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require 'yaml'
+require 'cucumber/cli/options'
module Cucumber
module Cli
describe Options do
@@ -322,9 +323,28 @@
end
end
+ describe "dry-run" do
+ it "should have the default value for snippets" do
+ given_cucumber_yml_defined_as({'foo' => %w[--dry-run]})
+ options.parse!(%w{--dry-run})
+ options[:snippets].should == true
+ end
+
+ it "should set snippets to false when no-snippets provided after dry-run" do
+ given_cucumber_yml_defined_as({'foo' => %w[--dry-run --no-snippets]})
+ options.parse!(%w{--dry-run --no-snippets})
+ options[:snippets].should == false
+ end
+
+ it "should set snippets to false when no-snippets provided before dry-run" do
+ given_cucumber_yml_defined_as({'foo' => %w[--no-snippet --dry-run]})
+ options.parse!(%w{--no-snippets --dry-run})
+ options[:snippets].should == false
+ end
+ end
end
end
end