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



22
23
24
# File 'lib/teaspoon/result.rb', line 22

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

Instance Method Details

#descriptionObject



26
27
28
# File 'lib/teaspoon/result.rb', line 26

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

#failing?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/teaspoon/result.rb', line 30

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

#passing?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/teaspoon/result.rb', line 34

def passing?
  status == "passed"
end

#pending?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/teaspoon/result.rb', line 38

def pending?
  status == "pending"
end