Class: ActiveRecordDocumentationFormatter
- Inherits:
-
RSpec::Core::Formatters::DocumentationFormatter
- Object
- RSpec::Core::Formatters::DocumentationFormatter
- ActiveRecordDocumentationFormatter
- Defined in:
- lib/rspec/activerecord/documentation_formatter.rb
Instance Attribute Summary collapse
-
#collector ⇒ Object
readonly
Returns the value of attribute collector.
-
#colorizer ⇒ Object
readonly
Returns the value of attribute colorizer.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
Instance Method Summary collapse
- #dump_summary(summary) ⇒ Object
- #example_group_finished(example_group) ⇒ Object
- #example_group_started(example_group) ⇒ Object
- #example_started(example) ⇒ Object
-
#initialize(output) ⇒ ActiveRecordDocumentationFormatter
constructor
A new instance of ActiveRecordDocumentationFormatter.
- #start(_start_notification) ⇒ Object
Constructor Details
#initialize(output) ⇒ ActiveRecordDocumentationFormatter
Returns a new instance of ActiveRecordDocumentationFormatter.
8 9 10 11 12 13 14 |
# File 'lib/rspec/activerecord/documentation_formatter.rb', line 8 def initialize(output) super @colorizer = ::RSpec::Core::Formatters::ConsoleCodes @collector = ActiveRecordFormatterHelpers::Collector.new @report = ActiveRecordFormatterHelpers::Report.new(collector) end |
Instance Attribute Details
#collector ⇒ Object (readonly)
Returns the value of attribute collector.
2 3 4 |
# File 'lib/rspec/activerecord/documentation_formatter.rb', line 2 def collector @collector end |
#colorizer ⇒ Object (readonly)
Returns the value of attribute colorizer.
2 3 4 |
# File 'lib/rspec/activerecord/documentation_formatter.rb', line 2 def colorizer @colorizer end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
2 3 4 |
# File 'lib/rspec/activerecord/documentation_formatter.rb', line 2 def report @report end |
Instance Method Details
#dump_summary(summary) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/rspec/activerecord/documentation_formatter.rb', line 35 def dump_summary(summary) base = ActiveRecordFormatterBase.new(summary, collector) output.puts base.colorized_summary output.puts "\nOutputting Detailed Profile Data to #{report.report_path}" report.write end |
#example_group_finished(example_group) ⇒ Object
26 27 28 29 |
# File 'lib/rspec/activerecord/documentation_formatter.rb', line 26 def example_group_finished(example_group) collector.group_finished(example_group.group) super end |
#example_group_started(example_group) ⇒ Object
21 22 23 24 |
# File 'lib/rspec/activerecord/documentation_formatter.rb', line 21 def example_group_started(example_group) collector.group_started(example_group.group) super end |
#example_started(example) ⇒ Object
31 32 33 |
# File 'lib/rspec/activerecord/documentation_formatter.rb', line 31 def example_started(example) collector.reset_example(example) end |
#start(_start_notification) ⇒ Object
16 17 18 19 |
# File 'lib/rspec/activerecord/documentation_formatter.rb', line 16 def start(_start_notification) output.puts "Recording and reporting ActiveRecord select and creation counts." super end |