Module: OoorUtils

Included in:
ScenarioUtils
Defined in:
lib/cucumber/lib/utils/ooor_utils.rb

Overview

OERPScenario, OpenERP Functional Tests

Author Nicolas Bessi 2009
Copyright Camptocamp SA

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 Afero of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Instance Method Summary collapse

Instance Method Details

#create_database_with_ooor(params = {}) ⇒ Object



55
56
57
58
# File 'lib/cucumber/lib/utils/ooor_utils.rb', line 55

def create_database_with_ooor(params={})
  ooor.create_database(config.merge(params))
  helper_hacks
end

#create_ooor_connection(params = {}) ⇒ Object



50
51
52
53
# File 'lib/cucumber/lib/utils/ooor_utils.rb', line 50

def create_ooor_connection(params={})
  ooor.open_connection(config.merge(params))
  helper_hacks
end

#createdatabasefromConf(params = {}) ⇒ Object



65
66
67
68
# File 'lib/cucumber/lib/utils/ooor_utils.rb', line 65

def createdatabasefromConf(params={})
  log.warn('Deprecated: ScenarioUtils#createdatabasefromConf. Use ScenarioUtils#create_database_with_ooor')
  create_database_with_ooor(params)
end

#helper_hacksObject



40
41
42
43
44
45
46
47
48
49
# File 'lib/cucumber/lib/utils/ooor_utils.rb', line 40

def helper_hacks()
  $helperlogger ||= Logger.new(STDOUT) #Temporary hack until helpers refactoring
  $helperlogger.level = Logger::WARN
  begin
    load_helpers
  rescue Exception => e
    $helperlogger.warn('can not load scenario helpers')
  end

end

#init_ooorObject



28
29
30
# File 'lib/cucumber/lib/utils/ooor_utils.rb', line 28

def init_ooor
  OoorProxy.new(log)
end

#login(params = {}) ⇒ Object



36
37
38
# File 'lib/cucumber/lib/utils/ooor_utils.rb', line 36

def (params={})
  ooor.(config.merge(params))
end

#ooorObject



24
25
26
# File 'lib/cucumber/lib/utils/ooor_utils.rb', line 24

def ooor
  @ooor ||= init_ooor
end

#ready?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/cucumber/lib/utils/ooor_utils.rb', line 32

def ready?
  !ooor.nil? && ooor.all_loaded_models.size == 0
end

#setConnexionfromConf(params = {}) ⇒ Object



60
61
62
63
# File 'lib/cucumber/lib/utils/ooor_utils.rb', line 60

def setConnexionfromConf(params={})
  log.warn('Deprecated: ScenarioUtils#setConnexionfromConf. Use ScenarioUtils#create_ooor_connection')
  create_ooor_connection(params)
end