Class: RSpec::DescriptionConsistency::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/description_consistency/reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(output_stream:) ⇒ Reporter



6
7
8
# File 'lib/rspec/description_consistency/reporter.rb', line 6

def initialize(output_stream:)
  @output_stream = output_stream
end

Instance Method Details

#report(state) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rspec/description_consistency/reporter.rb', line 10

def report(state)
  return if state.data.empty?

  output_stream << "    RSpec::DescriptionConsistency detected the following potential inconsistencies:\n\n  TXT\n\n  state.data.each do |key, value|\n    output_stream.puts format_violation_entry(key, value)\n  end\nend\n"