Class: TestBalancer::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/test_balancer/test.rb

Direct Known Subclasses

Features::Test, Specs::Test

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, line = nil, execution_time = 0) ⇒ Test

Returns a new instance of Test.



6
7
8
9
10
# File 'lib/test_balancer/test.rb', line 6

def initialize path, line=nil, execution_time=0
  @path           = Pathname.new(path)
  @line           = line
  @execution_time = execution_time
end

Instance Attribute Details

#execution_timeObject

Returns the value of attribute execution_time.



4
5
6
# File 'lib/test_balancer/test.rb', line 4

def execution_time
  @execution_time
end

#lineObject (readonly)

Returns the value of attribute line.



3
4
5
# File 'lib/test_balancer/test.rb', line 3

def line
  @line
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/test_balancer/test.rb', line 3

def path
  @path
end

Instance Method Details

#inspectObject



12
13
14
# File 'lib/test_balancer/test.rb', line 12

def inspect
  "<#{self.class.name} #{to_s} #{execution_time}s>"
end

#to_sObject



16
17
18
# File 'lib/test_balancer/test.rb', line 16

def to_s
  line.nil? ? path.to_s : "#{path}:#{line}"
end