【发布时间】:2016-06-21 22:04:45
【问题描述】:
我正在尝试使用 capybara 创建一个 ruby rspec,但在尝试从哈希中删除部分字符串时出现此错误:无法修改冻结字符串
scenario "check doc" do
docs = {
'A doc' => 'a.txt',
'B doc' => 'b.txt',
'C doc' => 'c.txt'
}
random_doc = docs.keys.sample
page.should have_css('.class', :text => 'Document ' + random_doc.gsub!(' doc') + ' was selected')
任何帮助将不胜感激!
【问题讨论】: