Class: ActiveRecordFormatterBase
- Inherits:
-
Object
- Object
- ActiveRecordFormatterBase
- Defined in:
- lib/rspec/activerecord/base.rb
Instance Attribute Summary collapse
-
#collector ⇒ Object
readonly
Returns the value of attribute collector.
-
#colorizer ⇒ Object
readonly
Returns the value of attribute colorizer.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
Instance Method Summary collapse
- #colorized_summary ⇒ Object
-
#initialize(summary, collector) ⇒ ActiveRecordFormatterBase
constructor
A new instance of ActiveRecordFormatterBase.
Constructor Details
#initialize(summary, collector) ⇒ ActiveRecordFormatterBase
Returns a new instance of ActiveRecordFormatterBase.
4 5 6 7 8 |
# File 'lib/rspec/activerecord/base.rb', line 4 def initialize(summary, collector) @colorizer = ::RSpec::Core::Formatters::ConsoleCodes @summary = summary @collector = collector end |
Instance Attribute Details
#collector ⇒ Object (readonly)
Returns the value of attribute collector.
2 3 4 |
# File 'lib/rspec/activerecord/base.rb', line 2 def collector @collector end |
#colorizer ⇒ Object (readonly)
Returns the value of attribute colorizer.
2 3 4 |
# File 'lib/rspec/activerecord/base.rb', line 2 def colorizer @colorizer end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
2 3 4 |
# File 'lib/rspec/activerecord/base.rb', line 2 def summary @summary end |
Instance Method Details
#colorized_summary ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rspec/activerecord/base.rb', line 10 def colorized_summary formatted = "\nFinished in #{summary.formatted_duration} " \ "(files took #{summary.formatted_load_time} to load)\n" \ "#{}\n" unless summary.failed_examples.empty? formatted << summary.colorized_rerun_commands(colorizer) << "\n" end formatted end |