Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix the tests, too

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7879 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit a1b823e20e32d375d4d283d401c36d9c31f18b0d 1 parent 2570b78
@jamis jamis authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 test/upload_test.rb
View
8 test/upload_test.rb
@@ -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! }
@@ -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)
@@ -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)
@@ -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"))
Please sign in to comment.
Something went wrong with that request. Please try again.