Class: RSpec::DescriptionConsistency::Reporter
- Inherits:
-
Object
- Object
- RSpec::DescriptionConsistency::Reporter
- Defined in:
- lib/rspec/description_consistency/reporter.rb
Instance Method Summary collapse
-
#initialize(output_stream:) ⇒ Reporter
constructor
A new instance of Reporter.
- #report(state) ⇒ Object
Constructor Details
#initialize(output_stream:) ⇒ Reporter
Returns a new instance of 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 << <<~TXT RSpec::DescriptionConsistency detected the following potential inconsistencies: TXT state.data.each do |key, value| output_stream.puts format_violation_entry(key, value) end end |