2010-04-13 09:50:25 -06:00
|
|
|
Given /^I am using (ActiveRecord|DataMapper|MongoMapper|Mongoid|CouchPotato)$/ do |orm|
|
2009-03-03 21:53:21 -07:00
|
|
|
@orm = orm
|
|
|
|
end
|
|
|
|
|
|
|
|
Given /^the (.+) cleaning strategy$/ do |strategy|
|
|
|
|
@strategy = strategy
|
|
|
|
end
|
|
|
|
|
|
|
|
When "I run my scenarios that rely on a clean database" do
|
|
|
|
full_dir ||= File.expand_path(File.dirname(__FILE__) + "/../../examples/")
|
|
|
|
Dir.chdir(full_dir) do
|
|
|
|
ENV['ORM'] = @orm.downcase
|
|
|
|
ENV['STRATEGY'] = @strategy
|
2010-02-17 14:48:43 -06:00
|
|
|
@out = `#{"jruby -S " if defined?(JRUBY_VERSION)}cucumber features`
|
2009-03-03 21:53:21 -07:00
|
|
|
@status = $?.exitstatus
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then "I should see all green" do
|
|
|
|
unless @status == 0
|
|
|
|
raise "Expected to see all green but we saw FAIL! Output:\n#{@out}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|