Class: Jasmine::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/jasmine/result.rb

Defined Under Namespace

Classes: Failure

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Result

Returns a new instance of Result.



8
9
10
11
12
13
14
15
16
17
# File 'lib/jasmine/result.rb', line 8

def initialize(attrs)
  @show_full_stack_trace = attrs["show_full_stack_trace"]
  @status = attrs["status"]
  @full_name = attrs["fullName"]
  @description = attrs["description"]
  @failed_expectations = map_failures(attrs.fetch("failedExpectations", []))
  @deprecation_warnings = map_failures(attrs.fetch("deprecationWarnings", []))
  @suite_name = full_name.slice(0, full_name.size - description.size - 1)
  @pending_reason = attrs["pendingReason"]
end

Instance Attribute Details

#deprecation_warningsObject (readonly)

Returns the value of attribute deprecation_warnings.



35
36
37
# File 'lib/jasmine/result.rb', line 35

def deprecation_warnings
  @deprecation_warnings
end

#descriptionObject (readonly)

Returns the value of attribute description.



35
36
37
# File 'lib/jasmine/result.rb', line 35

def description
  @description
end

#failed_expectationsObject (readonly)

Returns the value of attribute failed_expectations.



35
36
37
# File 'lib/jasmine/result.rb', line 35

def failed_expectations
  @failed_expectations
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



35
36
37
# File 'lib/jasmine/result.rb', line 35

def full_name
  @full_name
end

#pending_reasonObject (readonly)

Returns the value of attribute pending_reason.



35
36
37
# File 'lib/jasmine/result.rb', line 35

def pending_reason
  @pending_reason
end

#suite_nameObject (readonly)

Returns the value of attribute suite_name.



35
36
37
# File 'lib/jasmine/result.rb', line 35

def suite_name
  @suite_name
end

Class Method Details

.map_raw_results(raw_results) ⇒ Object



4
5
6
# File 'lib/jasmine/result.rb', line 4

def self.map_raw_results(raw_results)
  raw_results.map { |r| new(r) }
end

Instance Method Details

#disabled?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/jasmine/result.rb', line 31

def disabled?
  status == 'disabled'
end

#failed?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/jasmine/result.rb', line 23

def failed?
  status == 'failed'
end

#pending?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/jasmine/result.rb', line 27

def pending?
  status == 'pending'
end

#succeeded?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/jasmine/result.rb', line 19

def succeeded?
  status == 'passed'
end