Module: RSpec::Proverbs::DocumentationFormatter::InstanceMethods
- Defined in:
- lib/proverbs/rspec/documentation_formatter.rb
Instance Method Summary collapse
- #example_passed_with_steps(notification) ⇒ Object
- #example_started(notification) ⇒ Object
- #example_started_with_steps(notification) ⇒ Object
- #example_step_failed(notification) ⇒ Object
- #example_step_passed(notification) ⇒ Object
- #example_step_pending(notification) ⇒ Object
Instance Method Details
#example_passed_with_steps(notification) ⇒ Object
64 65 66 |
# File 'lib/proverbs/rspec/documentation_formatter.rb', line 64 def example_passed_with_steps(notification) example_passed_without_steps(notification) unless notification.example.[:with_steps] end |
#example_started(notification) ⇒ Object
19 |
# File 'lib/proverbs/rspec/documentation_formatter.rb', line 19 def example_started(notification); end |
#example_started_with_steps(notification) ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/proverbs/rspec/documentation_formatter.rb', line 56 def example_started_with_steps(notification) example_started_without_steps(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
31 32 33 34 35 36 37 38 39 |
# File 'lib/proverbs/rspec/documentation_formatter.rb', line 31 def example_step_failed(notification) no_keyword_display = %w(specify example it rule fact step test) keyword = notification.type.to_s = "#{current_indentation} #{keyword.capitalize} #{notification.} (FAILED)" unless no_keyword_display.include?(keyword) = "#{current_indentation} #{notification.} (FAILED)" if no_keyword_display.include?(keyword) output.puts Core::Formatters::ConsoleCodes.wrap(, :failure) end |
#example_step_passed(notification) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/proverbs/rspec/documentation_formatter.rb', line 21 def example_step_passed(notification) no_keyword_display = %w(specify example it rule fact step test) keyword = notification.type.to_s = "#{current_indentation} #{keyword.capitalize} #{notification.}" unless no_keyword_display.include?(keyword) = "#{current_indentation} #{notification.}" if no_keyword_display.include?(keyword) output.puts Core::Formatters::ConsoleCodes.wrap(, :success) end |
#example_step_pending(notification) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/proverbs/rspec/documentation_formatter.rb', line 41 def example_step_pending(notification) no_keyword_display = %w(specify example it rule fact step test) keyword = notification.type.to_s = "#{current_indentation} #{keyword.capitalize} #{notification.}" unless no_keyword_display.include?(keyword) = "#{current_indentation} #{notification.}" if no_keyword_display.include?(keyword) pending_check = notification.[:pending] && notification.[:pending] << " (PENDING: #{notification.[:pending]})" unless pending_check << ' (PENDING)' if pending_check output.puts Core::Formatters::ConsoleCodes.wrap(, :pending) end |