Module NullDB::RSpec::NullifiedDatabase
In: lib/nulldb_rspec.rb

Methods

Classes and Modules

Class NullDB::RSpec::NullifiedDatabase::HaveExecuted

Constants

NullDBAdapter = ActiveRecord::ConnectionAdapters::NullDBAdapter

Public Class methods

Public Instance methods

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.

[Validate]