Skip to content

Commit

Permalink
Adding a test to check if -g respects the -f parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sgarciac committed Sep 17, 2014
1 parent 6d5949d commit 309ddce
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/spinach/cli_test.rb
Expand Up @@ -148,17 +148,28 @@
end

describe 'generate' do
%w{-g --generate}.each do |opt|
it 'inits the generator if #{opt}' do
%w{-g --generate}.each do |generate_opt|
it 'inits the generator if #{generate_opt}' do
config = Spinach::Config.new
Spinach.stubs(:config).returns(config)

Spinach::Generators.expects(:run)

Spinach::Cli.new([opt]).run
Spinach::Cli.new([generate_opt]).run

config.generate.must_equal true
end

%w{-f --features_path}.each do |feature_path_opt|
it "honors the #{feature_path_opt} option" do
config = Spinach::Config.new
Spinach.stubs(:config).returns(config)
cli = Spinach::Cli.new([feature_path_opt,"custom_path", generate_opt])
cli.options
config.features_path.must_equal 'custom_path'
end
end

end
end

Expand Down

0 comments on commit 309ddce

Please sign in to comment.