Class: Teaspoon::Result

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_from_json(json) ⇒ Object



20
21
22
# File 'lib/teaspoon/result.rb', line 20

def self.build_from_json(json)
  new(*RESULT_ATTRS.map { |attr| json[attr.to_s] })
end

Instance Method Details

#descriptionObject



24
25
26
# File 'lib/teaspoon/result.rb', line 24

def description
  "#{suite} #{label}"
end

#failing?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/teaspoon/result.rb', line 28

def failing?
  (status != "passed" && status != "pending") && type == "spec"
end

#passing?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/teaspoon/result.rb', line 32

def passing?
  status == "passed"
end

#pending?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/teaspoon/result.rb', line 36

def pending?
  status == "pending"
end