Sha256: dcdd6fefa2a99da19616993e14994b9d0d94a50eb0768289b9cc41547e452dd8
Contents?: true
Size: 859 Bytes
Versions: 1
Compression:
Stored size: 859 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 def initialize(configuration = Configuration::AppConfiguration.default) @configuration = configuration end def matches?(actual) self.examiner = Examiner.new(actual, configuration: configuration) 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 private private_attr_reader :configuration private_attr_accessor :examiner end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
reek-3.3.0 | lib/reek/spec/should_reek.rb |