Sha256: 5e6f5d16f308eebd14e9ea3c00d1d8066856dc5d8ddb80459d5dd28a6f706d21

Contents?: true

Size: 645 Bytes

Versions: 5

Compression:

Stored size: 645 Bytes

Contents

require 'phut'

Before do
  @pid_dir = '.'
  @log_dir = '.'
  @socket_dir = '.'
end

Before('@sudo') do
  fail 'sudo authentication failed' unless system 'sudo -v'
  @aruba_timeout_seconds = 10
end

Before('@shell') do
  fail 'sudo authentication failed' unless system 'sudo -v'
end

After('@sudo') do
  in_current_dir do
    Phut.pid_dir = @pid_dir
    Phut.log_dir = @log_dir
    Phut.socket_dir = @socket_dir
    Phut::Parser.new.parse(@config_file).stop
  end
end

After('@shell') do
  in_current_dir do
    Dir.glob(File.join(Dir.getwd, '*.pid')).each do |each|
      pid = IO.read(each).to_i
      run "sudo kill #{pid}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
phut-0.2.4 features/support/hooks.rb
phut-0.2.3 features/support/hooks.rb
phut-0.2.2 features/support/hooks.rb
phut-0.2.0 features/support/hooks.rb
phut-0.1.0 features/support/hooks.rb