1

在 ruby​​mine 4.5.3 中,我尝试运行一个场景:

Scenario: I want to buy icecream, then watch a movie
  Given I am at a mall
  When I buy icecream
  Then I should be allowed to watch a movie

该场景包含一个逗号,因此当我右键单击并点击播放时,元素名称过滤器如下所示:

I want to buy icecream\, then watch a movie

但后来我得到了这个堆栈跟踪:

too short escape sequence (ArgumentError)
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/options.rb:194:in `block (2 levels) in parse!'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1360:in `call'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1360:in `block in parse_in_order'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1347:in `catch'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1347:in `parse_in_order'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1341:in `order!'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1432:in `permute!'
C:/ruby193/lib/ruby/1.9.1/optparse.rb:1453:in `parse!'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/options.rb:119:in `parse!'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/configuration.rb:25:in `parse!'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:55:in `configuration'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:63:in `run_drb_client'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:34:in `execute!'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute'
C:/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>'
C:/ruby193/bin/cucumber:23:in `load'
C:/ruby193/bin/cucumber:23:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'

为了解决这个问题,我更改了元素名称过滤器,并删除了反斜杠:

I want to buy icecream, then watch a movie

现在场景运行正常。

难道我做错了什么?

编辑:刚刚确认双引号也会出现同样的问题

编辑:确认问题仍然存在于 RubyMine 4.5.4

4

0 回答 0