Class: RSpec::CapturingFormatter::Configuration
- Inherits:
-
Object
- Object
- RSpec::CapturingFormatter::Configuration
- Defined in:
- lib/rspec/capturing_formatter/configuration.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#emoji ⇒ Object
Returns the value of attribute emoji.
-
#separator ⇒ Object
Returns the value of attribute separator.
-
#slow_threshold ⇒ Object
Returns the value of attribute slow_threshold.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #pending_failure_output ⇒ Object
-
#pending_failure_output=(value) ⇒ Object
Keep "unset" distinct from explicit :full so CapturingFormatter can inherit RSpec's setting.
- #pending_failure_output_configured? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 14 |
# File 'lib/rspec/capturing_formatter/configuration.rb', line 8 def initialize @slow_threshold = 0.5 @separator = " › " @color = true @emoji = :auto @pending_failure_output = nil end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
6 7 8 |
# File 'lib/rspec/capturing_formatter/configuration.rb', line 6 def color @color end |
#emoji ⇒ Object
Returns the value of attribute emoji.
6 7 8 |
# File 'lib/rspec/capturing_formatter/configuration.rb', line 6 def emoji @emoji end |
#separator ⇒ Object
Returns the value of attribute separator.
6 7 8 |
# File 'lib/rspec/capturing_formatter/configuration.rb', line 6 def separator @separator end |
#slow_threshold ⇒ Object
Returns the value of attribute slow_threshold.
6 7 8 |
# File 'lib/rspec/capturing_formatter/configuration.rb', line 6 def slow_threshold @slow_threshold end |
Instance Method Details
#pending_failure_output ⇒ Object
58 59 60 |
# File 'lib/rspec/capturing_formatter/configuration.rb', line 58 def pending_failure_output @pending_failure_output || :full end |
#pending_failure_output=(value) ⇒ Object
Keep "unset" distinct from explicit :full so CapturingFormatter can inherit RSpec's setting.
50 51 52 53 54 55 56 |
# File 'lib/rspec/capturing_formatter/configuration.rb', line 50 def pending_failure_output=(value) unless [:full, :no_backtrace, :skip].include?(value) raise ArgumentError, "pending_failure_output must be :full, :no_backtrace, or :skip" end @pending_failure_output = value end |
#pending_failure_output_configured? ⇒ Boolean
62 63 64 |
# File 'lib/rspec/capturing_formatter/configuration.rb', line 62 def pending_failure_output_configured? !@pending_failure_output.nil? end |
#to_h ⇒ Object
66 67 68 69 70 71 72 73 74 |
# File 'lib/rspec/capturing_formatter/configuration.rb', line 66 def to_h { slow_threshold: @slow_threshold, separator: @separator, color: @color, emoji: @emoji, pending_failure_output: pending_failure_output } end |