Module: MemoizerUtils

Included in:
ScenarioUtils
Defined in:
lib/cucumber/lib/utils/memoizer_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

#clean_all_varObject



37
38
39
# File 'lib/cucumber/lib/utils/memoizer_utils.rb', line 37

def clean_all_var
  memoizer.clear
end

#clean_var(name) ⇒ Object



33
34
35
# File 'lib/cucumber/lib/utils/memoizer_utils.rb', line 33

def clean_var(name)
  memoizer.delete(name)
end

#get_var(name) ⇒ Object



29
30
31
# File 'lib/cucumber/lib/utils/memoizer_utils.rb', line 29

def get_var(name)
  memoizer[name]
end

#set_var(name, value) ⇒ Object

Define a memorizer to store object handled by the test Useful to store an invoice in a var which name = invoice name !



25
26
27
# File 'lib/cucumber/lib/utils/memoizer_utils.rb', line 25

def set_var(name, value)
  memoizer[name] = value
end