Class: Heidi::Tester

Inherits:
Object
  • Object
show all
Defined in:
lib/heidi/tester.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(integrator) ⇒ Tester

Returns a new instance of Tester.



5
6
7
8
9
10
# File 'lib/heidi/tester.rb', line 5

def initialize(integrator)
  @integrator = integrator
  @build      = integrator.build
  @project    = @build.project
  @message    = ""
end

Instance Attribute Details

#buildObject (readonly)

Returns the value of attribute build.



3
4
5
# File 'lib/heidi/tester.rb', line 3

def build
  @build
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/heidi/tester.rb', line 3

def message
  @message
end

#projectObject (readonly)

Returns the value of attribute project.



3
4
5
# File 'lib/heidi/tester.rb', line 3

def project
  @project
end

Instance Method Details

#test!Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/heidi/tester.rb', line 12

def test!
  build.log(:info, "Starting tests")

  if build.hooks[:tests].empty?
    build.log(:error, "There are no test hooks")
    @message = "There are no test hooks"
    return false
  end

  return @integrator.run_hooks(:tests)
end