Module: Calabash::Cucumber::SimulatorHelper Deprecated

Defined in:
lib/calabash-cucumber/launch/simulator_helper.rb

Overview

Deprecated.

0.9.169 Use the SimulatorLauncher class instead.

This module has been replaced by Simulator Launcher

Class Method Summary collapse

Class Method Details

.stopObject

Deprecated.

0.9.169 replaced with SimulatorLauncher.new().stop

Quits the simulator.

This has been deprecated, but it appears in legacy launch hooks.

Use this pattern instead:

“‘ at_exit do

launcher = Calabash::Cucumber::Launcher.new
if launcher.simulator_target?
  launcher.simulator_launcher.stop unless launcher.calabash_no_stop?
end

end “‘



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/calabash-cucumber/launch/simulator_helper.rb', line 27

def self.stop
  unless ENV['CALABASH_NO_DEPRECATION'] == '1'
    if RUBY_VERSION < '2.0'
      stack = Kernel.caller()[1..6].join("\n")
    else
      stack = Kernel.caller(0, 6)[1..-1].join("\n")
    end

    msgs = ['The Calabash::Cucumber::SimulatorHelper module has been replaced.',
            'Please replace:',
            '',
            '    Calabash::Cucumber::SimulatorHelper.stop',
            '',
            'with this:',
            '',
            '    launcher = Calabash::Cucumber::Launcher.new',
            '    launcher.simulator_launcher.stop',
            '',
            'The stack trace below will show you the line number you need to change.']

    msg = "deprecated '0.9.169' - #{msgs.join("\n")}\n#{stack}"

    begin
      STDERR.puts "\033[34m\nWARN: #{msg}\033[0m"
    rescue
      STDERR.puts "\nWARN: #{msg}"
    end
  end
  simulator = SimLauncher::Simulator.new()
  simulator.quit_simulator
  simulator
end