Changeset 7377
- Timestamp:
- 08/30/07 14:43:12 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/capistrano/test/deploy/strategy/copy_test.rb
r7131 r7377 27 27 mock_file.expects(:puts).with("154") 28 28 File.expects(:open).with("/temp/dir/1234567890/REVISION", "w").yields(mock_file) 29 File.expects(: read).with("/temp/dir/1234567890.tar.gz").returns(:mock_file_contents)29 File.expects(:open).with("/temp/dir/1234567890.tar.gz", "rb").yields(StringIO.new).returns(:mock_file_contents) 30 30 31 31 FileUtils.expects(:rm).with("/temp/dir/1234567890.tar.gz") … … 49 49 mock_file.expects(:puts).with("154") 50 50 File.expects(:open).with("/temp/dir/1234567890/REVISION", "w").yields(mock_file) 51 File.expects(: read).with("/temp/dir/1234567890.tar.gz").returns(:mock_file_contents)51 File.expects(:open).with("/temp/dir/1234567890.tar.gz", "rb").yields(StringIO.new).returns(:mock_file_contents) 52 52 53 53 FileUtils.expects(:rm).with("/temp/dir/1234567890.tar.gz") … … 71 71 mock_file.expects(:puts).with("154") 72 72 File.expects(:open).with("/temp/dir/1234567890/REVISION", "w").yields(mock_file) 73 File.expects(: read).with("/temp/dir/1234567890.zip").returns(:mock_file_contents)73 File.expects(:open).with("/temp/dir/1234567890.zip", "rb").yields(StringIO.new).returns(:mock_file_contents) 74 74 75 75 FileUtils.expects(:rm).with("/temp/dir/1234567890.zip") … … 93 93 mock_file.expects(:puts).with("154") 94 94 File.expects(:open).with("/temp/dir/1234567890/REVISION", "w").yields(mock_file) 95 File.expects(: read).with("/temp/dir/1234567890.tar.bz2").returns(:mock_file_contents)95 File.expects(:open).with("/temp/dir/1234567890.tar.bz2", "rb").yields(StringIO.new).returns(:mock_file_contents) 96 96 97 97 FileUtils.expects(:rm).with("/temp/dir/1234567890.tar.bz2") … … 115 115 mock_file.expects(:puts).with("154") 116 116 File.expects(:open).with("/other/path/1234567890/REVISION", "w").yields(mock_file) 117 File.expects(: read).with("/other/path/1234567890.tar.gz").returns(:mock_file_contents)117 File.expects(:open).with("/other/path/1234567890.tar.gz", "rb").yields(StringIO.new).returns(:mock_file_contents) 118 118 119 119 FileUtils.expects(:rm).with("/other/path/1234567890.tar.gz") … … 137 137 mock_file.expects(:puts).with("154") 138 138 File.expects(:open).with("/temp/dir/1234567890/REVISION", "w").yields(mock_file) 139 File.expects(: read).with("/temp/dir/1234567890.tar.gz").returns(:mock_file_contents)139 File.expects(:open).with("/temp/dir/1234567890.tar.gz", "rb").yields(StringIO.new).returns(:mock_file_contents) 140 140 141 141 FileUtils.expects(:rm).with("/temp/dir/1234567890.tar.gz")