Class: Reek::Spec::ShouldReekOf
Overview
:nodoc:
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
Constructor Details
#initialize(klass, patterns) ⇒ ShouldReekOf
Returns a new instance of ShouldReekOf.
64 65 66 67 |
# File 'lib/reek/spec.rb', line 64 def initialize(klass, patterns) @klass = klass @patterns = patterns end |
Instance Method Details
#failure_message_for_should ⇒ Object
72 73 74 |
# File 'lib/reek/spec.rb', line 72 def "Expected #{@source} to reek of #{@klass}, but it didn't" end |
#failure_message_for_should_not ⇒ Object
75 76 77 |
# File 'lib/reek/spec.rb', line 75 def "Expected #{@source} not to reek of #{@klass}, but got:\n#{@source.report}" end |
#matches?(actual) ⇒ Boolean
68 69 70 71 |
# File 'lib/reek/spec.rb', line 68 def matches?(actual) @source = actual.to_source @source.has_smell?(@klass, @patterns) end |