Class: Reek::Spec::ShouldReek

Inherits:
Object
  • Object
show all
Includes:
ReekMatcher
Defined in:
lib/reek/adapters/spec.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from ReekMatcher

#report

Instance Method Details

#failure_message_for_shouldObject



59
60
61
# File 'lib/reek/adapters/spec.rb', line 59

def failure_message_for_should
  "Expected #{@sniffer.desc} to reek, but it didn't"
end

#failure_message_for_should_notObject



62
63
64
# File 'lib/reek/adapters/spec.rb', line 62

def failure_message_for_should_not
  "Expected no smells, but got:\n#{report}"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
58
# File 'lib/reek/adapters/spec.rb', line 55

def matches?(actual)
  @sniffer = actual.sniff
  @sniffer.smelly?
end