Module: CucumberHelper::Commons::Commands

Defined in:
lib/cucumber_helper/commons/command_helpers.rb

Instance Method Summary collapse

Instance Method Details

#dupObject



20
21
22
23
24
# File 'lib/cucumber_helper/commons/command_helpers.rb', line 20

def dup
  Marshal.load(Marshal.dump(self))
rescue Exception
  old_dup
end

#old_dupObject



4
# File 'lib/cucumber_helper/commons/command_helpers.rb', line 4

alias old_dup dup

#production?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/cucumber_helper/commons/command_helpers.rb', line 16

def production?
  @tags.include?('@production') && ENV['BASE_URL'].include?('mekari.com')
end

#save_variable(name, value) ⇒ Object

save variable to instance variable or global variable if prefix is ‘$’



7
8
9
10
11
12
13
14
# File 'lib/cucumber_helper/commons/command_helpers.rb', line 7

def save_variable(name, value)
  if name.start_with? '$'
    create_global = "#{name} = '#{value}'"
    Module.module_eval create_global
  else
    instance_variable_set("@#{name}", value)
  end
end