2010-07-23 75 views
1

我想要去除下面的黃瓜表達報價,但我得到未知步錯誤如何去除黃瓜中的報價然後步驟?

Then I should see "[\"20257\"]\n" 

黃瓜建議我這個:(

Then /^I should see "([^"]*)"(\d+)\\"([^"]*)"$/ do |arg1, arg2, arg3| 
    pending # express the regexp above with the code you wish you had 
end 

任何想法,如何在這一步剝離?

回答

2

如何寫作:

Then I should see "["20257"]\n" 

隨着臺階的:

Then /^I should see "(.*)"$/ do |txt| 
    txt.gsub!('\n', "\n") 
    # ... 
end 

或者你可以使用的多參數""",甚至不用擔心\n替代。