Class: Jasmine::Headless::ReportMessage::Total

Inherits:
Object
  • Object
show all
Defined in:
lib/jasmine/headless/report_message/total.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(total, failed, time, has_js_error) ⇒ Total

Returns a new instance of Total.



11
12
13
14
15
16
17
18
19
20
# File 'lib/jasmine/headless/report_message/total.rb', line 11

def initialize(total, failed, time, has_js_error)
  @total, @failed, @time = total.to_i, failed.to_i, time.to_f

  @has_js_error = case has_js_error
  when String
    has_js_error == "T"
  else
    has_js_error
  end
end

Instance Attribute Details

#failedObject (readonly)

Returns the value of attribute failed.



9
10
11
# File 'lib/jasmine/headless/report_message/total.rb', line 9

def failed
  @failed
end

#has_js_errorObject (readonly)

Returns the value of attribute has_js_error.



9
10
11
# File 'lib/jasmine/headless/report_message/total.rb', line 9

def has_js_error
  @has_js_error
end

#timeObject (readonly)

Returns the value of attribute time.



9
10
11
# File 'lib/jasmine/headless/report_message/total.rb', line 9

def time
  @time
end

#totalObject (readonly)

Returns the value of attribute total.



9
10
11
# File 'lib/jasmine/headless/report_message/total.rb', line 9

def total
  @total
end

Class Method Details

.new_from_parts(parts) ⇒ Object



4
5
6
# File 'lib/jasmine/headless/report_message/total.rb', line 4

def new_from_parts(parts)
  new(*parts)
end

Instance Method Details

#==(other) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/jasmine/headless/report_message/total.rb', line 22

def ==(other)
  other &&
  self.total == other.total &&
  self.failed == other.failed &&
  self.time == other.time &&
  self.has_js_error == other.has_js_error
end