Class: Reek::Spec::ShouldReek

Inherits:
Object
  • Object
show all
Defined in:
lib/reek/spec/should_reek.rb

Overview

An rspec matcher that matches when the actual has code smells.

Instance Method Summary collapse

Instance Method Details

#failure_messageObject


17
18
19
# File 'lib/reek/spec/should_reek.rb', line 17

def failure_message
  "Expected #{@examiner.description} to reek, but it didn't"
end

#failure_message_when_negatedObject


21
22
23
24
# File 'lib/reek/spec/should_reek.rb', line 21

def failure_message_when_negated
  rpt = Cli::Report::Formatter.format_list(@examiner.smells)
  "Expected no smells, but got:\n#{rpt}"
end

#matches?(actual) ⇒ Boolean

:nodoc:


12
13
14
15
# File 'lib/reek/spec/should_reek.rb', line 12

def matches?(actual)
  @examiner = Examiner.new(actual)
  @examiner.smelly?
end