Class: NullDB::RSpec::NullifiedDatabase::HaveExecuted
- Defined in:
- lib/nulldb_rspec.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(entry_point) ⇒ HaveExecuted
constructor
A new instance of HaveExecuted.
- #matches?(connection) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(entry_point) ⇒ HaveExecuted
Returns a new instance of HaveExecuted.
13 14 15 |
# File 'lib/nulldb_rspec.rb', line 13 def initialize(entry_point) @entry_point = entry_point end |
Instance Method Details
#description ⇒ Object
26 27 28 |
# File 'lib/nulldb_rspec.rb', line 26 def description "connection should execute #{@entry_point} statement" end |
#failure_message ⇒ Object
30 31 32 |
# File 'lib/nulldb_rspec.rb', line 30 def " did not execute #{@entry_point} statement when it should have" end |
#matches?(connection) ⇒ Boolean
17 18 19 20 21 22 23 24 |
# File 'lib/nulldb_rspec.rb', line 17 def matches?(connection) log = connection.execution_log_since_checkpoint if @entry_point == :anything not log.empty? else log.include?(NullDBAdapter::Statement.new(@entry_point)) end end |
#negative_failure_message ⇒ Object
34 35 36 |
# File 'lib/nulldb_rspec.rb', line 34 def " executed #{@entry_point} statement when it should not have" end |