我一直在玩黃瓜約三週,現在一切正常,除了這裏的小東西。用「--tags」運行黃瓜時出現「無效選項」錯誤
每當我運行我的測試例如cucumber checkout.feature --tags @monthly
,我得到我的控制檯上下面的測試已成功運行後:
invalid option: --tags
Test::Unit automatic runner.
Usage: /Users/myusername/.rvm/gems/ruby-2.0.0-p0/bin/cucumber [options] [-- untouched arguments]
-r, --runner=RUNNER Use the given RUNNER.
(c[onsole], e[macs], x[ml])
--collector=COLLECTOR Use the given COLLECTOR.
(de[scendant], di[r], l[oad], o[bject]_space)
-n, --name=NAME Runs tests matching NAME.
(patterns may be used).
--ignore-name=NAME Ignores tests matching NAME.
(patterns may be used).
-t, --testcase=TESTCASE Runs tests in TestCases matching TESTCASE.
(patterns may be used).
--ignore-testcase=TESTCASE Ignores tests in TestCases matching TESTCASE.
(patterns may be used).
--location=LOCATION Runs tests that defined in LOCATION.
LOCATION is one of PATH:LINE, PATH or LINE
--attribute=EXPRESSION Runs tests that matches EXPRESSION.
EXPRESSION is evaluated as Ruby's expression.
Test attribute name can be used with no receiver in EXPRESSION.
EXPRESSION examples:
!slow
tag == 'important' and !slow
--[no-]priority-mode Runs some tests based on their priority.
--default-priority=PRIORITY Uses PRIORITY as default priority
(h[igh], i[mportant], l[ow], m[ust], ne[ver], no[rmal])
-I, --load-path=DIR[:DIR...] Appends directory list to $LOAD_PATH.
--color-scheme=SCHEME Use SCHEME as color scheme.
(d[efault])
--config=FILE Use YAML fomat FILE content as configuration file.
--order=ORDER Run tests in a test case in ORDER order.
(a[lphabetic], d[efined], r[andom])
--max-diff-target-string-size=SIZE
Shows diff if both expected result string size and actual result string size are less than or equal SIZE in bytes.
(1000)
-v, --verbose=[LEVEL] Set the output level (default is verbose).
(important-only, n[ormal], p[rogress], s[ilent], v[erbose])
--[no-]use-color=[auto] Uses color output
(default is auto)
--progress-row-max=MAX Uses MAX as max terminal width for progress mark
(default is auto)
--no-show-detail-immediately Shows not passed test details immediately.
(default is yes)
--output-file-descriptor=FD Outputs to file descriptor FD
-- Stop processing options so that the
remaining options will be passed to the
test.
-h, --help Display this help.
Deprecated options:
--console Console runner (use --runner).
我可能並不需要把所有的,在這裏,但我想給你的多文本的顯示方式上的印象我的屏幕在每次測試之後,可能有點分散注意力。
這裏是我的設置:
的Gemfile
source 'https://rubygems.org'
gem "rspec"
gem "cucumber"
gem "capybara"
gem "capybara-webkit"
gem "selenium"
gem "selenium-client"
gem "selenium-webdriver"
env.rb
require_relative '../../../config.rb'
require 'capybara/cucumber'
require 'capybara/rspec'
Capybara.app_host = AT_ROOT
Capybara.default_driver = :selenium
Capybara.javascript_driver = :webkit
Capybara.default_wait_time = DEFAULT_WAIT_TIME
Capybara.ignore_hidden_elements = IGNORE_HIDDEN_ELEMENTS
# Define window size of the browser here
Capybara.current_session.driver.browser.manage.window.resize_to(DEFAULT_WINDOW_HEIGHT, DEFAULT_WINDOW_WIDTH)
我找不到在控制檯輸出到Test::Unit automatic runner
任何連接,但顯然這與它有關。
你有什麼想法可能是什麼?我發現了一些與這個問題有關的線索,但他們並沒有幫助我。
謝謝
你使用哪個版本的黃瓜和捆紮機的? – 2013-03-14 20:32:39
黃瓜:1.2.1 Bundler:1.3.0 – TrashyMcTrash 2013-03-15 10:29:55
Cucumber [僅支持來自1.2.2的Ruby 2.0](https://github.com/cucumber/cucumber/blob/master/History.md) – 2013-03-15 13:41:59