Module: Cucumber::Rails::Database
- Defined in:
- lib/cucumber/rails/database.rb,
lib/cucumber/rails/database/strategy.rb,
lib/cucumber/rails/database/deletion_strategy.rb,
lib/cucumber/rails/database/truncation_strategy.rb,
lib/cucumber/rails/database/shared_connection_strategy.rb
Defined Under Namespace
Classes: DeletionStrategy, InvalidStrategy, SharedConnectionStrategy, Strategy, TruncationStrategy
Constant Summary
collapse
- CUSTOM_STRATEGY_INTERFACE =
%w[before_js before_non_js].freeze
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.autorun_database_cleaner ⇒ Object
Returns the value of attribute autorun_database_cleaner.
11
12
13
|
# File 'lib/cucumber/rails/database.rb', line 11
def autorun_database_cleaner
@autorun_database_cleaner
end
|
Class Method Details
.after ⇒ Object
41
42
43
|
# File 'lib/cucumber/rails/database.rb', line 41
def after
@strategy.after
end
|
.before_js ⇒ Object
33
34
35
|
# File 'lib/cucumber/rails/database.rb', line 33
def before_js
@strategy.before_js
end
|
.before_non_js ⇒ Object
37
38
39
|
# File 'lib/cucumber/rails/database.rb', line 37
def before_non_js
@strategy.before_non_js
end
|
.default_strategy! ⇒ Object
28
29
30
31
|
# File 'lib/cucumber/rails/database.rb', line 28
def default_strategy!
self.javascript_strategy = :truncation
self.autorun_database_cleaner = true
end
|
.javascript_strategy=(args) ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/cucumber/rails/database.rb', line 13
def javascript_strategy=(args)
strategy, *strategy_opts = args
strategy_type =
case strategy
when Symbol
map[strategy] || throw_invalid_strategy_error(strategy)
when Class
strategy
end
@strategy = strategy_type.new(*strategy_opts)
validate_interface!
end
|