Skip to content

Commit

Permalink
fix the tests, too
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7879 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jamis committed Oct 14, 2007
1 parent 2570b78 commit a1b823e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/upload_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_self_process_should_instantiate_uploader_and_start_process

def test_process_when_sftp_open_fails_should_raise_error
sftp = mock_sftp
sftp.expects(:open).with("test.txt", @mode, 0660).yields(mock("status", :code => "bad status", :message => "bad status"), :file_handle)
sftp.expects(:open).with("test.txt", @mode, 0664).yields(mock("status", :code => "bad status", :message => "bad status"), :file_handle)
session = mock("session", :sftp => sftp, :xserver => server("capistrano"))
upload = Capistrano::Upload.new([session], "test.txt", :data => "data", :logger => stub_everything)
assert_raises(Capistrano::UploadError) { upload.process! }
Expand All @@ -43,7 +43,7 @@ def test_process_when_sftp_open_fails_should_raise_error

def test_process_when_sftp_write_fails_should_raise_error
sftp = mock_sftp
sftp.expects(:open).with("test.txt", @mode, 0660).yields(mock("status1", :code => Net::SFTP::Session::FX_OK), :file_handle)
sftp.expects(:open).with("test.txt", @mode, 0664).yields(mock("status1", :code => Net::SFTP::Session::FX_OK), :file_handle)
sftp.expects(:write).with(:file_handle, "data").yields(mock("status2", :code => "bad status", :message => "bad status"))
session = mock("session", :sftp => sftp, :xserver => server("capistrano"))
upload = Capistrano::Upload.new([session], "test.txt", :data => "data", :logger => stub_everything)
Expand All @@ -54,7 +54,7 @@ def test_process_when_sftp_write_fails_should_raise_error

def test_upload_error_should_include_accessor_with_host_array
sftp = mock_sftp
sftp.expects(:open).with("test.txt", @mode, 0660).yields(mock("status1", :code => Net::SFTP::Session::FX_OK), :file_handle)
sftp.expects(:open).with("test.txt", @mode, 0664).yields(mock("status1", :code => Net::SFTP::Session::FX_OK), :file_handle)
sftp.expects(:write).with(:file_handle, "data").yields(mock("status2", :code => "bad status", :message => "bad status"))
session = mock("session", :sftp => sftp, :xserver => server("capistrano"))
upload = Capistrano::Upload.new([session], "test.txt", :data => "data", :logger => stub_everything)
Expand All @@ -70,7 +70,7 @@ def test_upload_error_should_include_accessor_with_host_array

def test_process_when_sftp_succeeds_should_raise_nothing
sftp = mock_sftp
sftp.expects(:open).with("test.txt", @mode, 0660).yields(mock("status1", :code => Net::SFTP::Session::FX_OK), :file_handle)
sftp.expects(:open).with("test.txt", @mode, 0664).yields(mock("status1", :code => Net::SFTP::Session::FX_OK), :file_handle)
sftp.expects(:write).with(:file_handle, "data").yields(mock("status2", :code => Net::SFTP::Session::FX_OK))
sftp.expects(:close_handle).with(:file_handle).yields
session = mock("session", :sftp => sftp, :xserver => server("capistrano"))
Expand Down

0 comments on commit a1b823e

Please sign in to comment.