模糊匹配发现在同一行

时间:2014-04-23 19:17:27

标签: ruby regex cucumber

我的测试最近开始失败。在一个单独的项目上工作。它说同一行和一行对它自己来说是模棱两可的。

    Cucumber::Ambiguous: Ambiguous match of "Store test data for StoreSource to file":

    features/step_definitions/write_step_details_definitions.rb:143:in `/^Store test data for ([^"]*) to file$/'
    features/step_definitions/write_step_details_definitions.rb:143:in `/^Store test data for ([^"]*) to file$/'

    You can run again with --guess to make Cucumber be more smart about it

它所指的那条线也是:

 And(/^Store test data for ([^"]*) to file$/) do |testSite|
   #Being Phased out
   env = FigNewton.base_url.downcase
   env.gsub!( /[\W_]+/,'' )

   path = env.upcase

   $testSite = testSite + '_'


   $fileName = GetFileData.getFileName path, $testSite, $TIME_STAMP
   puts "New File name: #{$fileName}"

   GetFileData.new()

   count = GetFileData.getRowCount $fileName

   data = "#{count + 1}) Test for #{testSite}."
   data = "\n" + data unless GetFileData.hasContent path, $testSite, $TIME_STAMP

   step "Write data to file data: #{data} at Path #{$fileName}"

 end

我查看了整个项目,看到没有相似或匹配的正则表达式。任何人都知道问题的真正含义。它指向同一行两次。我甚至不确定要发布什么其他内容

0 个答案:

没有答案