1

我使用 Cucumber 测试我的 Rails 应用程序,并且由于运行了 Spork,我不必在每次运行场景时都启动整个 Rails 应用程序。

我在 TextMate 中设置了TM_CUCUMBER_OPTSto --drb,它工作得很好,但它导致结果的格式很尴尬:它只是文本,不再是 HTML。

有什么办法可以解决吗?我尝试了 --format=html,但这会导致:

Running: /Users/josh/.rvm/bin/rvm-auto-ruby /Users/josh/Documents/Work/Sientia/iq/script/cucumber 
/Users/josh/Documents/Work/Sientia/iq/features/authorization/sign_out.feature --drb --format=html
    Using the default profile...
    Disabling profiles...
    Exception encountered: #<RuntimeError: All but one formatter must use --out, only one can print to each stream (or STDOUT)>
    backtrace:
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/cucumber-1.2.1/lib/cucumber/cli/configuration.rb:198:in `arrange_formats'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/cucumber-1.2.1/lib/cucumber/cli/configuration.rb:26:in `parse!'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:55:in `configuration'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:63:in `run_drb_client'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:34:in `execute!'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/spork-0.9.2/lib/spork/test_framework/cucumber.rb:24:in `run_tests'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:13:in `block in run'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/spork-0.9.2/lib/spork/forker.rb:21:in `block in initialize'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/spork-0.9.2/lib/spork/forker.rb:18:in `fork'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/spork-0.9.2/lib/spork/forker.rb:18:in `initialize'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `new'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `run'
    /Users/josh/.rvm/gems/ruby-1.9.3-p0@iq/gems/spork-0.9.2/lib/spork/server.rb:48:in `run'
    /Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
    /Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
    /Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
    /Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
    /Users/josh/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'

关于如何解决这个问题的任何想法?谢谢。

4

1 回答 1

1

Jim Drannbauer 的解决方案为我工作:http: //jimdrannbauer.com/2011/02/22/cucumber-spork-textmate-drb-drbunknown/

于 2012-10-03T18:16:44.160 回答