Sha256: c0438fb34597f81fd1b1ea85a88b1c16139cd4a363b1fac46e3d693562bbc8f4
Contents?: true
Size: 1.59 KB
Versions: 3
Compression:
Stored size: 1.59 KB
Contents
# encoding: utf-8 require File.expand_path('../../spec_helper.rb', __FILE__) require 'frank/publish/sftp' describe Frank::Publish::SFTP do let(:publisher) do Frank::Publish::SFTP.new(Frank.publish) do |scp| scp.username = 'my_username' scp.password = 'my_password' scp.hostname = 'scp.example.com' scp.local_path = '/local/path' scp.remote_path = '/remote/path' end end before(:all) do Frank.bootstrap(File.join(File.dirname(__FILE__), 'template')) end describe '#initialize' do it 'should set the correct values' do publisher.username.should == 'my_username' publisher.password.should == 'my_password' publisher.hostname.should == 'scp.example.com' publisher.port.should == 22 publisher.local_path.should == '/local/path' publisher.remote_path.should == '/remote/path' end end # describe '#initialize' describe '#connection' do let(:connection) { mock } it 'should yield a connection to the remote server' do Net::SFTP.expects(:start).with('scp.example.com', 'my_username', :password => 'my_password').yields(connection) publisher.send(:connection) do |scp| scp.should be(connection) end end end # describe '#connection' describe '#transfer!' do let(:connection) { mock } before do publisher.stubs(:connection).yields(connection) end it 'should transfer the local_path to remote_path using upload!' do connection.expects(:upload!).with('/local/path', '/remote/path') publisher.send(:transfer!) end end # describe '#transfer!' end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
frank-1.0.12 | spec/publish/sftp_spec.rb |
frank-1.0.11 | spec/publish/sftp_spec.rb |
frank-1.0.10 | spec/publish/sftp_spec.rb |