Class: DontRepeatYourself::UnitTestingHelpers::RSpecMatchers::BeDRYMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/dont_repeat_yourself/unit_testing_helpers.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



48
49
50
# File 'lib/dont_repeat_yourself/unit_testing_helpers.rb', line 48

def description
  "follow the 'Don't Repeat Yourself' principle " << @project.description
end

#failure_messageObject



52
53
54
# File 'lib/dont_repeat_yourself/unit_testing_helpers.rb', line 52

def failure_message
  @project.failure_message
end

#matches?(project) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'lib/dont_repeat_yourself/unit_testing_helpers.rb', line 38

def matches?(project)
  @project = project
  @project.is_dry?
end

#negative_failure_messageObject

TODO Do we really need this? It does not make a lot of sense



44
45
46
# File 'lib/dont_repeat_yourself/unit_testing_helpers.rb', line 44

def negative_failure_message
  "expected #{@project.name} to have more than #{@project.maximum_number_of_duplicate_lines_i_want_in_my_project} duplicate lines :\n but found the following:\n "
end