Close SSH session before exiting

This commit is contained in:
Thibault Jouan
2014-07-01 19:54:33 +00:00
parent 9359f2e595
commit 336003d2d7
6 changed files with 31 additions and 0 deletions

View File

@@ -172,6 +172,11 @@ module Producer::Core
.with([an_instance_of(Task), an_instance_of(Task)])
cli.run
end
it 'cleans up the env' do
expect(cli.env).to receive :cleanup
cli.run
end
end
describe '#load_recipe' do

View File

@@ -157,5 +157,12 @@ module Producer::Core
expect(env).to be_dry_run
end
end
describe '#cleanup' do
it 'cleans up the remote' do
expect(env.remote).to receive :cleanup
env.cleanup
end
end
end
end

View File

@@ -136,5 +136,14 @@ module Producer::Core
expect(remote.environment['FOO']).to eq 'bar'
end
end
describe '#cleanup' do
before { remote.session = double 'session' }
it 'closes the session' do
expect(remote.session).to receive :close
remote.cleanup
end
end
end
end