Module: NullDB::RSpec::NullifiedDatabase
- Defined in:
- lib/nulldb_rspec.rb
Defined Under Namespace
Classes: HaveExecuted
Constant Summary collapse
- NullDBAdapter =
ActiveRecord::ConnectionAdapters::NullDBAdapter
Class Method Summary collapse
Instance Method Summary collapse
-
#have_executed(entry_point) ⇒ Object
A matcher for asserting that database statements have (or have not) been executed.
Class Method Details
.contextually_nullify_database(context) ⇒ Object
48 49 50 |
# File 'lib/nulldb_rspec.rb', line 48 def self.contextually_nullify_database(context) nullify_database(context) end |
Instance Method Details
#have_executed(entry_point) ⇒ Object
A matcher for asserting that database statements have (or have not) been executed. Usage:
ActiveRecord::Base.connection.should have_executed(:insert)
The types of statement that can be matched mostly mirror the public operations available in ActiveRecord::ConnectionAdapters::DatabaseStatements:
-
:select_one
-
:select_all
-
:select_value
-
:insert
-
:update
-
:delete
-
:execute
There is also a special :anything symbol that will match any operation.
69 70 71 |
# File 'lib/nulldb_rspec.rb', line 69 def have_executed(entry_point) HaveExecuted.new(entry_point) end |