Skip to content

Commit

Permalink
Merge pull request #647 from aleksandrs-ledovskis/chore/ssh-auth-sock…
Browse files Browse the repository at this point in the history
…-test-lab-cleanup

Clear SSH_AUTH_SOCK for duration of test run
  • Loading branch information
mfazekas committed Dec 12, 2018
2 parents 6250263 + f9bb669 commit f07a936
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
$_original_config_default_files = Net::SSH::Config.default_files.dup # rubocop:disable Style/GlobalVars
Net::SSH::Config.default_files.clear

# Ensures SSH_AUTH_SOCK set outside of test scenario (e.g. on dev's machine) isn't messing up test assertions
original_ssh_auth_sock, ENV['SSH_AUTH_SOCK'] = ENV['SSH_AUTH_SOCK'], nil
Minitest.after_run { ENV['SSH_AUTH_SOCK'] = original_ssh_auth_sock }

def with_restored_default_files(&block)
act_default_files = Net::SSH::Config.default_files.dup
begin
Expand Down

0 comments on commit f07a936

Please sign in to comment.