Class: Remarkable::ActiveRecord::Matchers::CallbackMatcher
- Inherits:
-
Matcher::Base
- Object
- Matcher::Base
- Remarkable::ActiveRecord::Matchers::CallbackMatcher
- Defined in:
- lib/remarkable/active_record/macros/callbacks/callback_matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(callback, method) ⇒ CallbackMatcher
constructor
A new instance of CallbackMatcher.
- #matches?(subject) ⇒ Boolean
Methods inherited from Matcher::Base
#failure_message, #negative, #negative_failure_message, #spec
Methods included from Matcher::DSL
Constructor Details
#initialize(callback, method) ⇒ CallbackMatcher
Returns a new instance of 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 |