Class: DontRepeatYourself::UnitTestingHelpers::RSpecMatchers::BeDRY

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

Instance Method Summary collapse

Instance Method Details

#descriptionObject



54
55
56
# File 'lib/dont_repeat_yourself/unit_testing_helpers.rb', line 54

def description
  "be " << @project.description
end

#failure_messageObject



58
59
60
# File 'lib/dont_repeat_yourself/unit_testing_helpers.rb', line 58

def failure_message
  @project.failure_message
end

#matches?(project) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#negative_failure_messageObject

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



50
51
52
# File 'lib/dont_repeat_yourself/unit_testing_helpers.rb', line 50

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