Class: RspecLogFormatter::Analysis::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build_number, time, outcome, description, spec_path, message = nil, klass = nil, duration = nil) ⇒ Result

Returns a new instance of Result.


6
7
8
9
10
11
12
13
14
15
# File 'lib/rspec_log_formatter/analysis/result.rb', line 6

def initialize(build_number, time, outcome, description, spec_path, message=nil, klass=nil,duration=nil)
  @time = Time.parse(time)
  @build_number = (build_number || -1).to_i
  @description = description
  @outcome = outcome
  @spec_path = spec_path
  @message = message
  @klass = klass
  @duration = duration.to_f
end

Instance Attribute Details

#build_numberObject

Returns the value of attribute build_number


17
18
19
# File 'lib/rspec_log_formatter/analysis/result.rb', line 17

def build_number
  @build_number
end

#descriptionObject

Returns the value of attribute description


17
18
19
# File 'lib/rspec_log_formatter/analysis/result.rb', line 17

def description
  @description
end

#durationObject

Returns the value of attribute duration


17
18
19
# File 'lib/rspec_log_formatter/analysis/result.rb', line 17

def duration
  @duration
end

#klassObject (readonly)

Returns the value of attribute klass


18
19
20
# File 'lib/rspec_log_formatter/analysis/result.rb', line 18

def klass
  @klass
end

#messageObject (readonly)

Returns the value of attribute message


18
19
20
# File 'lib/rspec_log_formatter/analysis/result.rb', line 18

def message
  @message
end

#timeObject (readonly)

Returns the value of attribute time


18
19
20
# File 'lib/rspec_log_formatter/analysis/result.rb', line 18

def time
  @time
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)

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

def failure?
  @outcome == "failed"
end

#success?Boolean

Returns:

  • (Boolean)

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

def success?
  @outcome == "passed"
end