Class: RSpec::Signal::Backtrace::Reduced
- Inherits:
-
Object
- Object
- RSpec::Signal::Backtrace::Reduced
- Defined in:
- lib/rspec/signal/backtrace/reducer.rb
Overview
The result of reducing one backtrace.
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#fallback ⇒ Object
readonly
Returns the value of attribute fallback.
-
#omitted ⇒ Object
readonly
Returns the value of attribute omitted.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#culprit ⇒ Object
The frame that best identifies where this blew up: the innermost frame that is not test-runner plumbing.
- #empty? ⇒ Boolean
- #fallback? ⇒ Boolean
- #frames ⇒ Object
-
#initialize(entries:, total:, omitted:, fallback: false) ⇒ Reduced
constructor
A new instance of Reduced.
- #kept_count ⇒ Object
- #omitted_count ⇒ Object
-
#primary_location ⇒ Object
The innermost first-party frame — what the agent should open first.
- #project_frames ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize(entries:, total:, omitted:, fallback: false) ⇒ Reduced
Returns a new instance of Reduced.
29 30 31 32 33 34 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 29 def initialize(entries:, total:, omitted:, fallback: false) @entries = entries @total = total @omitted = omitted @fallback = fallback end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
27 28 29 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 27 def entries @entries end |
#fallback ⇒ Object (readonly)
Returns the value of attribute fallback.
27 28 29 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 27 def fallback @fallback end |
#omitted ⇒ Object (readonly)
Returns the value of attribute omitted.
27 28 29 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 27 def omitted @omitted end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
27 28 29 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 27 def total @total end |
Instance Method Details
#culprit ⇒ Object
The frame that best identifies where this blew up: the innermost frame that is not test-runner plumbing.
46 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 46 def culprit = frames.first |
#empty? ⇒ Boolean
40 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 40 def empty? = frames.empty? |
#fallback? ⇒ Boolean
39 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 39 def fallback? = @fallback |
#frames ⇒ Object
36 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 36 def frames = entries.select(&:frame?) |
#kept_count ⇒ Object
38 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 38 def kept_count = frames.size |
#omitted_count ⇒ Object
42 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 42 def omitted_count = omitted.values.sum |
#primary_location ⇒ Object
The innermost first-party frame — what the agent should open first.
49 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 49 def primary_location = project_frames.first |
#project_frames ⇒ Object
37 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 37 def project_frames = frames.select(&:project?) |
#to_a ⇒ Object
51 |
# File 'lib/rspec/signal/backtrace/reducer.rb', line 51 def to_a = entries.map(&:to_s) |