2012-07-30 72 views
0

Rspec书说,运行cucumber features -n命令。但它是从黄瓜源给下面的错误错误与:黄瓜功能-n命令

missing argument: -n (OptionParser::MissingArgument) 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/gems/cucumber- 1.2.1/lib/cucumber/cli/options.rb:119:in `parse!' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/gems/cucumber-1.2.1/lib/cucumber/cli/configuration.rb:25:in `parse!' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:55:in `configuration' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:63:in `run_drb_client' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:34:in `execute!' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/bin/cucumber:19:in `load' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/bin/cucumber:19:in `<main>' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `eval' 
/Users/pajama/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `<main>' 

回答

1

opts.on("-n NAME", "--name NAME", 
     "Only execute the feature elements which match part of the given name.", 
     "If this option is given more than once, it will match against all the", 
     "given names.") 

所以你需要调用-n name_of_the_feature

+0

会'-n .'怎么办? – 2012-07-30 12:35:40

+1

我不明白你在做什么?!如果你想运行所有的功能,只需跳过这个选项! – phoet 2012-07-30 12:47:08