Class: Remarkable::ActiveRecord::Matchers::CallbackMatcher
- Inherits:
-
Matcher::Base
- Object
- Matcher::Base
- Remarkable::ActiveRecord::Matchers::CallbackMatcher
show all
- Defined in:
- lib/remarkable/active_record/macros/callbacks/callback_matcher.rb
Instance Method Summary
collapse
#failure_message, #negative, #negative_failure_message, #spec
included
Constructor Details
#initialize(callback, method) ⇒ CallbackMatcher
12
13
14
15
|
# File 'lib/remarkable/active_record/macros/callbacks/callback_matcher.rb', line 12
def initialize(callback, method)
@callback = callback
@method = method
end
|
Instance Method Details
#description ⇒ Object
22
23
24
|
# File 'lib/remarkable/active_record/macros/callbacks/callback_matcher.rb', line 22
def description
"have a #{@callback} callback named #{@method}"
end
|
#matches?(subject) ⇒ Boolean
17
18
19
20
|
# File 'lib/remarkable/active_record/macros/callbacks/callback_matcher.rb', line 17
def matches?(subject)
@subject = subject
assert_matcher { has_callback? }
end
|