Sha256: 2f099e57dcbd9a7f350b8af0c1eca084841f87c29f1e966c2c6c504279715ed7

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

Given /^an ssh agent has been launched without parameters$/ do
  pending
end

Given /^an ssh agent has been launched with a specific socket$/ do
  @agentIO = IO.popen('ssh-agent -a /tmp/ssh-locate-test.15970')
  @agentOutput = @agentIO.read
  @agentIO.close
  @agentPID = @agentOutput[/PID=(\d+)/,1].to_i
  @agentSocket = @agentOutput[/SOCK=([\w\-._\/]+)/,1]
  # The agent is shutdown in the 'after' hook
end

Given /^an SSH agent has been launched in my Ubuntu session$/ do
  pending
end

Given /^no agent is running$/ do
  @agentPID=nil
  @agentSocket=nil
end

Given /^an ssh agent is running for another user$/ do
  pending # express the regexp above with the code you wish you had
end

Given /^no ssh agent is running for me$/ do
  pending # express the regexp above with the code you wish you had
end

Then /^the output should be empty$/ do
  expect(all_output).to be_empty
end

Then /^the output should contain the correct agent PID$/ do
  expect(all_output).to include @agentPID.to_s
end

Then /^the output should contain the correct agent socket$/ do
  expect(all_output).to  include @agentSocket.to_s
end

Given("the user's shell is Fish") do
  set_environment_variable('SHELL', 'fish')
end

Given("the user's shell is Bash") do
  set_environment_variable('SHELL', 'bash')
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ssh-locate-0.4.0 features/step_definitions/agent-ids.rb