Sha256: dba3dba6ca0f6147127a55ae0a1c8e0a522388d5e14a9b7155950fc37664375a

Contents?: true

Size: 986 Bytes

Versions: 1

Compression:

Stored size: 986 Bytes

Contents

Given(/^the app suite is loaded$/) do
  @app = Cumuli::App.new({
    env: 'test',
    wait_time: 5,
    log_dir: File.dirname(__FILE__) + "/../../spec/fixtures/log",
    app_dir: File.dirname(__FILE__) + "/../../spec/fixtures/app_set"
  })
  @app.start
  @app.wait_for_apps
  @pid = @app.pid
end

Given(/^the current thread is listening for signals$/) do
  @signals = []

  ['KILL', 'INT', 'TERM', 'HUP'].each do |signal|
    trap signal do
      @signals << signal
    end
  end
end

When(/^I shutdown the app suite$/) do
  step "the current thread is listening for signals"
  @app.stop
end

When(/^the forked pid receives an (.*) signal$/) do |signal|
  step "the current thread is listening for signals"
  Process.kill(signal, @pid)
end

Then(/^I should see that the rake was not aborted$/) do
  @signals.should be_empty
end

Then(/^the processes should not be running$/) do
  Cumuli::Waiter.new.wait_until(3) do
    report = Cumuli::PS.new.report(@pid)
    report.empty?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cumuli-0.3.4 features/step_definitions/app_steps.rb