File: database_cleaner_steps.rb

package info (click to toggle)
ruby-database-cleaner 1.7.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 768 kB
  • sloc: ruby: 4,854; makefile: 10; sh: 4
file content (33 lines) | stat: -rw-r--r-- 1,004 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
orms_pattern = /(ActiveRecord|DataMapper|Sequel|MongoMapper|Mongoid|CouchPotato|Redis|Ohm|Neo4j)/

Given /^I am using #{orms_pattern}$/ do |orm|
  @feature_runner = FeatureRunner.new
  @feature_runner.orm = orm
end

Given /^I am using #{orms_pattern} and #{orms_pattern}$/ do |orm1,orm2|
  @feature_runner = FeatureRunner.new
  @feature_runner.orm         = orm1
  @feature_runner.another_orm = orm2
end

Given /^the (.+) cleaning strategy$/ do |strategy|
  @feature_runner.strategy = strategy
end

When "I run my scenarios that rely on a clean database" do
  @feature_runner.go 'example'
end

When "I run my scenarios that rely on clean databases" do
  @feature_runner.multiple_databases = true
  @feature_runner.go 'example_multiple_db'
end

When "I run my scenarios that rely on clean databases using multiple orms" do
  @feature_runner.go 'example_multiple_orm'
end

Then "I should see all green" do
  fail "Feature failed with :#{@feature_runner.output}" unless @feature_runner.exit_status == 0
end