Class: RSpec::TestSpec::Formatter
- Inherits:
-
Core::Formatters::DocumentationFormatter
- Object
- Core::Formatters::DocumentationFormatter
- RSpec::TestSpec::Formatter
- Defined in:
- lib/test_spec/rspec/formatter.rb
Instance Method Summary collapse
- #example_passed(notification) ⇒ Object
-
#example_started(notification) ⇒ Object
rubocop:disable Metrics/LineLength.
-
#example_step_failed(notification) ⇒ Object
rubocop:enable Metrics/AbcSize rubocop:enable Style/ConditionalAssignment.
- #example_step_passed(notification) ⇒ Object
-
#example_step_pending(notification) ⇒ Object
rubocop:disable Metrics/AbcSize rubocop:disable Style/ConditionalAssignment.
Instance Method Details
#example_passed(notification) ⇒ Object
20 21 22 |
# File 'lib/test_spec/rspec/formatter.rb', line 20 def example_passed(notification) super unless notification.example.[:with_steps] end |
#example_started(notification) ⇒ Object
rubocop:disable Metrics/LineLength
13 14 15 16 17 18 |
# File 'lib/test_spec/rspec/formatter.rb', line 13 def example_started(notification) return unless notification.example.[:with_steps] = "#{current_indentation}#{notification.example.description}" output.puts Core::Formatters::ConsoleCodes.wrap(, :default) end |
#example_step_failed(notification) ⇒ Object
rubocop:enable Metrics/AbcSize rubocop:enable Style/ConditionalAssignment
46 47 48 49 |
# File 'lib/test_spec/rspec/formatter.rb', line 46 def example_step_failed(notification) = "#{current_indentation} #{notification.type.to_s.capitalize} #{notification.message} (FAILED)" output.puts Core::Formatters::ConsoleCodes.wrap(, :failure) end |
#example_step_passed(notification) ⇒ Object
24 25 26 27 |
# File 'lib/test_spec/rspec/formatter.rb', line 24 def example_step_passed(notification) = "#{current_indentation} #{notification.type.to_s.capitalize} #{notification.message}" output.puts Core::Formatters::ConsoleCodes.wrap(, :success) end |
#example_step_pending(notification) ⇒ Object
rubocop:disable Metrics/AbcSize rubocop:disable Style/ConditionalAssignment
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/test_spec/rspec/formatter.rb', line 31 def example_step_pending(notification) = "#{current_indentation} #{notification.type.to_s.capitalize} #{notification.message}" if notification.[:pending] && notification.[:pending] != true << " (PENDING: #{notification.options[:pending]})" else << " (PENDING)" end output.puts Core::Formatters::ConsoleCodes.wrap(, :pending) end |