Class: Reek::Spec::ShouldReekOf
- Includes:
- ReekMatcher
- Defined in:
- lib/reek/adapters/spec.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(klass, patterns) ⇒ ShouldReekOf
constructor
A new instance of ShouldReekOf.
- #matches?(actual) ⇒ Boolean
Methods included from ReekMatcher
Constructor Details
#initialize(klass, patterns) ⇒ ShouldReekOf
Returns a new instance of ShouldReekOf.
70 71 72 73 |
# File 'lib/reek/adapters/spec.rb', line 70 def initialize(klass, patterns) @klass = klass @patterns = patterns end |
Instance Method Details
#failure_message_for_should ⇒ Object
78 79 80 |
# File 'lib/reek/adapters/spec.rb', line 78 def "Expected #{@sniffer.desc} to reek of #{@klass}, but it didn't" end |
#failure_message_for_should_not ⇒ Object
81 82 83 |
# File 'lib/reek/adapters/spec.rb', line 81 def "Expected #{@sniffer.desc} not to reek of #{@klass}, but got:\n#{report}" end |
#matches?(actual) ⇒ Boolean
74 75 76 77 |
# File 'lib/reek/adapters/spec.rb', line 74 def matches?(actual) @sniffer = actual.sniff @sniffer.has_smell?(@klass, @patterns) end |