Sha256: 268eec3c5f6443850c7d099c83d615ebf430c8bc47168d5301c3a8f14e018c62

Contents?: true

Size: 622 Bytes

Versions: 5

Compression:

Stored size: 622 Bytes

Contents

require_relative '../examiner'
require_relative '../report/formatter'

module Reek
  module Spec
    #
    # An rspec matcher that matches when the +actual+ has code smells.
    #
    # @api private
    class ShouldReek        # :nodoc:
      def matches?(actual)
        @examiner = Examiner.new(actual)
        @examiner.smelly?
      end

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
reek-3.0.4 lib/reek/spec/should_reek.rb
reek-3.0.3 lib/reek/spec/should_reek.rb
reek-3.0.2 lib/reek/spec/should_reek.rb
reek-3.0.1 lib/reek/spec/should_reek.rb
reek-3.0.0 lib/reek/spec/should_reek.rb