Class: RSpec::SleepingKingStudios::Sandbox::Result
- Inherits:
-
Struct
- Object
- Struct
- RSpec::SleepingKingStudios::Sandbox::Result
- Defined in:
- lib/rspec/sleeping_king_studios/sandbox.rb
Overview
Value class for the result of calling a sandboxed spec file.
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#json ⇒ Object
Returns the value of attribute json.
-
#output ⇒ Object
Returns the value of attribute output.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#example_descriptions ⇒ Array<String>
The full description for each run example.
-
#failing_examples ⇒ Array<String>
The full description for each run example with status "failed".
-
#passing_examples ⇒ Array<String>
The full description for each run example with status "passed".
-
#pending_examples ⇒ Array<String>
The full description for each run example with status "pending".
-
#summary ⇒ String
The summary of the sandboxed spec run.
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors
16 17 18 |
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 16 def errors @errors end |
#json ⇒ Object
Returns the value of attribute json
16 17 18 |
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 16 def json @json end |
#output ⇒ Object
Returns the value of attribute output
16 17 18 |
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 16 def output @output end |
#status ⇒ Object
Returns the value of attribute status
16 17 18 |
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 16 def status @status end |
Instance Method Details
#example_descriptions ⇒ Array<String>
Returns the full description for each run example.
18 19 20 |
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 18 def example_descriptions json['examples'].map { |hsh| hsh['full_description'] } end |
#failing_examples ⇒ Array<String>
Returns the full description for each run example with status "failed".
24 25 26 27 28 |
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 24 def failing_examples json['examples'] .select { |hsh| hsh['status'] == 'failed' } .map { |hsh| hsh['full_description'] } end |
#passing_examples ⇒ Array<String>
Returns the full description for each run example with status "passed".
32 33 34 35 36 |
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 32 def passing_examples json['examples'] .select { |hsh| hsh['status'] == 'passed' } .map { |hsh| hsh['full_description'] } end |
#pending_examples ⇒ Array<String>
Returns the full description for each run example with status "pending".
40 41 42 43 44 |
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 40 def pending_examples json['examples'] .select { |hsh| hsh['status'] == 'pending' } .map { |hsh| hsh['full_description'] } end |
#summary ⇒ String
Returns the summary of the sandboxed spec run.
47 48 49 |
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 47 def summary json['summary_line'] end |