spec/chake/backend/ssh_spec.rb in chake-0.21.2 vs spec/chake/backend/ssh_spec.rb in chake-0.80

- old
+ new

@@ -1,17 +1,16 @@ require 'spec_helper' -describe Chake::Backend::Ssh do +describe Chake::Connection::Ssh do + include_examples 'Chake::Connection', Chake::Connection::Ssh - include_examples "Chake::Backend", Chake::Backend::Ssh + let(:node) { Chake::Node.new('ssh://myuser@myhost/srv/chake') } - let(:node) { Chake::Node.new('ssh://myuser@myhost/srv/chef') } + it('runs commands with ssh') { expect(connection.command_runner).to eq(['ssh', 'myuser@myhost']) } - it('runs commands with ssh') { expect(backend.command_runner).to eq(['ssh', 'myuser@myhost']) } + it('rsyncs over ssh') { expect(connection.rsync_dest).to eq('myuser@myhost:/srv/chake/') } - it('rsyncs over ssh') { expect(backend.rsync_dest).to eq('myuser@myhost:/srv/chef/') } - it 'uses no remote username if none was passed' do node = Chake::Node.new('theserver') expect(node.username).to eq(Etc.getpwuid.name) expect(node.remote_username).to be_nil end @@ -22,16 +21,15 @@ end context 'with a custom port' do let(:node) { Chake::Node.new('ssh://myhost:2222') } it 'uses port with ssh' do - expect(backend.command_runner).to eq(['ssh', '-p', '2222', 'myhost']) + expect(connection.command_runner).to eq(['ssh', '-p', '2222', 'myhost']) end it 'uses port with scp' do - expect(backend.scp).to eq(['scp', '-P', '2222']) + expect(connection.scp).to eq(['scp', '-P', '2222']) end it 'uses port with rsync' do - expect(backend.send(:rsync_ssh)).to eq(['-e', 'ssh -p 2222']) + expect(connection.send(:rsync_ssh)).to eq(['-e', 'ssh -p 2222']) end end - end