Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Cucumber 在每次运行前清理 TEST DB。
但是我有几个值应该始终在数据库中。 (“默认”的)。
有没有办法告诉 Cucumber 不要删除某些值? 还是在每次运行之前创建 mb?
只需将其放在背景部分的给定块中即可。
例如
Background: Given I have an item that exists Given /^I have and item that exists$/ do Item.create!(item_name: 'Name') end
希望这可以帮助。