Class: RSpec::SleepingKingStudios::Sandbox::Result

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#errorsObject

Returns the value of attribute errors

Returns:

  • (Object)

    the current value of errors



16
17
18
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 16

def errors
  @errors
end

#jsonObject

Returns the value of attribute json

Returns:

  • (Object)

    the current value of json



16
17
18
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 16

def json
  @json
end

#outputObject

Returns the value of attribute output

Returns:

  • (Object)

    the current value of output



16
17
18
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 16

def output
  @output
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



16
17
18
# File 'lib/rspec/sleeping_king_studios/sandbox.rb', line 16

def status
  @status
end

Instance Method Details

#example_descriptionsArray<String>

Returns the full description for each run example.

Returns:

  • (Array<String>)

    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_examplesArray<String>

Returns the full description for each run example with status "failed".

Returns:

  • (Array<String>)

    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_examplesArray<String>

Returns the full description for each run example with status "passed".

Returns:

  • (Array<String>)

    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_examplesArray<String>

Returns the full description for each run example with status "pending".

Returns:

  • (Array<String>)

    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

#summaryString

Returns the summary of the sandboxed spec run.

Returns:

  • (String)

    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