Class: Templater::Spec::Helpers::CreateMatcher
- Inherits:
-
Object
- Object
- Templater::Spec::Helpers::CreateMatcher
- Defined in:
- lib/templater/spec/helpers.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ CreateMatcher
constructor
A new instance of CreateMatcher.
- #matches?(actual) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(expected) ⇒ CreateMatcher
Returns a new instance of CreateMatcher.
42 43 44 |
# File 'lib/templater/spec/helpers.rb', line 42 def initialize(expected) @expected = expected end |
Instance Method Details
#failure_message ⇒ Object
52 53 54 |
# File 'lib/templater/spec/helpers.rb', line 52 def "expected #{@actual.inspect} to create #{@expected.inspect}, but it didn't" end |
#matches?(actual) ⇒ Boolean
46 47 48 49 50 |
# File 'lib/templater/spec/helpers.rb', line 46 def matches?(actual) @actual = actual # Satisfy expectation here. Return false or raise an error if it's not met. @actual.all_actions.map{|t| t.destination }.include?(@expected) end |
#negative_failure_message ⇒ Object
56 57 58 |
# File 'lib/templater/spec/helpers.rb', line 56 def "expected #{@actual.inspect} not to create #{@expected.inspect}, but it did" end |