Module: CucumberOpenERP

Defined in:
lib/cucumber/openerp/world.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#is_aliveObject

Returns the value of attribute is_alive.



3
4
5
# File 'lib/cucumber/openerp/world.rb', line 3

def is_alive
  @is_alive
end

#openerpObject

Returns the value of attribute openerp.



3
4
5
# File 'lib/cucumber/openerp/world.rb', line 3

def openerp
  @openerp
end

Instance Method Details

#am_i_alive?Boolean



5
6
7
8
# File 'lib/cucumber/openerp/world.rb', line 5

def am_i_alive?
  @@is_alive ||= false
  return @@is_alive
end

#bornObject



9
10
11
# File 'lib/cucumber/openerp/world.rb', line 9

def born
  @@is_alive = true
end

#openerp_ignitionObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/cucumber/openerp/world.rb', line 12

def openerp_ignition
  unless am_i_alive?
    openerp = ScenarioUtils.new() #$utils is deprecated please use openerp
    @@openerp_c = openerp
    begin
      unless openerp.ready?
        openerp.log.info("Attempt to connect")
        openerp.create_ooor_connection
      end
    rescue Exception => e
      openerp.log.warn("#{e.to_s}")
      openerp.log.warn("Force reconnect")
      openerp.create_ooor_connection
    end
    born
    $utils = openerp #for retro-compatibility
  end
  @openerp = @@openerp_c
end