Skip to content

Instantly share code, notes, and snippets.

@tomash
Created May 5, 2011 14:52
Show Gist options
  • Save tomash/957184 to your computer and use it in GitHub Desktop.
Save tomash/957184 to your computer and use it in GitHub Desktop.
output of backup's rspec
tomek@asus-laptop:~/ruby_apps/backup$ bundle exec rspec spec/
1) Backup::Encryptor::OpenSSL when a block is provided
Failure/Error: encryptor.password.should == "my_secret_password"
expected: "my_secret_password"
got: nil (using ==)
# ./spec/encryptor/open_ssl_spec.rb:37
2) Backup::Encryptor::OpenSSL when a block is provided
Failure/Error: encryptor.send(:salt).should == ['-salt']
expected: ["-salt"]
got: [] (using ==)
Diff:
@@ -1,2 +1,2 @@
-["-salt"]
+[]
# ./spec/encryptor/open_ssl_spec.rb:41
3) Backup::Encryptor::OpenSSL when a block is provided
Failure/Error: encryptor.send(:base64).should == ['-base64']
expected: ["-base64"]
got: [] (using ==)
Diff:
@@ -1,2 +1,2 @@
-["-base64"]
+[]
# ./spec/encryptor/open_ssl_spec.rb:45
4) Backup::Encryptor::OpenSSL when a block is provided
Failure/Error: encryptor.send(:options).should == "aes-256-cbc -base64 -salt"
expected: "aes-256-cbc -base64 -salt"
got: "aes-256-cbc" (using ==)
# ./spec/encryptor/open_ssl_spec.rb:49
5) Backup::Encryptor::OpenSSL#perform!
Failure/Error: encryptor.perform!
unexpected invocation: #<Backup::Encryptor::OpenSSL:0xb687a850>.run('openssl aes-256-cbc -in '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar' -out '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar.enc' -k ''')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Backup::Encryptor::OpenSSL:0xb687a850>.run('openssl aes-256-cbc -base64 -salt -in '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar' -out '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar.enc' -k 'my_secret_password'')
satisfied expectations:
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
- allowed any number of times, not yet invoked: #<Backup::Encryptor::OpenSSL:0xb687c510>.rm(any_parameters)
- allowed any number of times, not yet invoked: #<Backup::Encryptor::OpenSSL:0xb687c510>.run(any_parameters)
- allowed any number of times, not yet invoked: #<Backup::Encryptor::OpenSSL:0xb687c510>.utility(any_parameters)
- allowed any number of times, invoked once: #<Backup::Encryptor::OpenSSL:0xb687a850>.utility(any_parameters)
# ./lib/backup/encryptor/open_ssl.rb:36:in `perform!'
# ./spec/encryptor/open_ssl_spec.rb:76
6) Backup::Encryptor::GPG when a block is provided should strip initial whitespace from key lines
Failure/Error: encryptor.key.should == key
expected: "-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: GnuPG v1.4.11 (Darwin)\n\nmQENBE12G/8BCAC4mnlSMYMBwBYTHe5zURcnYYNCORPWOr0iXGiLWuKxYtrDQyLm\nX2Nws44Iz7Wp7AuJRAjkitf1cRBgXyDu8wuogXO7JqPmtsUdBCABz9w5NH6IQjgR\nWNa3g2n0nokA7Zr5FA4GXoEaYivfbvGiyNpd6P4okH+//G2p+3FIryu5xz+89D1b\n=Yvhg\n-----END PGP PUBLIC KEY BLOCK-----\n"
got: nil (using ==)
# ./spec/encryptor/gpg_spec.rb:35
7) Backup::Compressor::Gzip#perform! should perform the compression with the --best and --fast options
Failure/Error: compressor.perform!
unexpected invocation: #<Backup::Compressor::Gzip:0xb67a16b8>.run('gzip '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar'')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Backup::Compressor::Gzip:0xb67a16b8>.run('gzip --best --fast '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar'')
satisfied expectations:
- allowed any number of times, not yet invoked: #<Backup::Compressor::Gzip:0xb67a32ec>.utility(any_parameters)
- allowed any number of times, not yet invoked: #<Backup::Compressor::Gzip:0xb67a32ec>.run(any_parameters)
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
- allowed any number of times, invoked once: #<Backup::Compressor::Gzip:0xb67a16b8>.utility(any_parameters)
# ./lib/backup/compressor/gzip.rb:33:in `perform!'
# ./spec/compressor/gzip_spec.rb:42
8) Backup::Archive should have no paths
Failure/Error: archive.paths.count.should == 0
undefined method `count' for nil:NilClass
# ./spec/archive_spec.rb:19
9) Backup::Archive should have no excludes
Failure/Error: archive.excludes.count.should == 0
undefined method `count' for nil:NilClass
# ./spec/archive_spec.rb:24
10) Backup::Archive should have 3 paths
Failure/Error: archive.paths.count.should == 3
undefined method `count' for nil:NilClass
# ./spec/archive_spec.rb:28
11) Backup::Archive should have 2 excludes
Failure/Error: archive.excludes.count.should == 2
undefined method `count' for nil:NilClass
# ./spec/archive_spec.rb:32
12) Backup::Archive
Failure/Error: archive.name.should == :dummy_archive
expected: :dummy_archive
got: nil (using ==)
# ./spec/archive_spec.rb:36
13) Backup::Archive#paths_to_package should return a tar -c friendly string
Failure/Error: archive.send(:paths_to_package).should ==
undefined method `map' for nil:NilClass
# ./lib/backup/archive.rb:60:in `paths_to_package'
# ./spec/archive_spec.rb:41:in `send'
# ./spec/archive_spec.rb:41
14) Backup::Archive#paths_to_exclude should be empty
Failure/Error: archive.send(:paths_to_exclude).should be_nil
undefined method `any?' for nil:NilClass
# ./lib/backup/archive.rb:68:in `paths_to_exclude'
# ./spec/archive_spec.rb:49:in `send'
# ./spec/archive_spec.rb:49
15) Backup::Archive#paths_to_exclude should return a tar -c friendly string
Failure/Error: archive.send(:paths_to_exclude).should ==
undefined method `any?' for nil:NilClass
# ./lib/backup/archive.rb:68:in `paths_to_exclude'
# ./spec/archive_spec.rb:53:in `send'
# ./spec/archive_spec.rb:53
16) Backup::Archive#perform! should log the status
Failure/Error: archive.perform!
undefined method `map' for nil:NilClass
# ./lib/backup/archive.rb:51:in `perform!'
# ./spec/archive_spec.rb:87
17) Backup::Archive#perform! when both paths were added and paths that should be excluded were added should render both the syntax for the paths that be included as well as excluded
Failure/Error: archive.perform!
undefined method `map' for nil:NilClass
# ./lib/backup/archive.rb:51:in `perform!'
# ./spec/archive_spec.rb:69
18) Backup::Archive#perform! when there are paths to add, and no exclude patterns were defined should only render syntax for the defined paths
Failure/Error: archive.perform!
undefined method `to_str' for nil:NilClass
# ./lib/backup/cli.rb:36:in `mkdir'
# ./lib/backup/archive.rb:50:in `perform!'
# ./spec/archive_spec.rb:81
19) Backup::Storage::S3#transfer! should transfer the provided file to the bucket
Failure/Error: s3.send(:transfer!)
unexpected invocation: File.open('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Fog::Storage>.put_object('my-bucket', 'backups/myapp/2011.05.05.16.49.56.myapp.tar', #<Mock:Backup::Storage::S3::File>)
- expected exactly once, not yet invoked: File.open('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked twice: Fog::Storage.new(any_parameters)
- expected exactly once, invoked once: #<Mock:Fog::Storage>.sync_clock(any_parameters)
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
- expected exactly twice, invoked twice: #<Backup::Storage::S3:0xb69ea118>.remote_file(any_parameters)
# ./lib/backup/storage/s3.rb:85:in `transfer!'
# ./spec/storage/s3_spec.rb:84:in `send'
# ./spec/storage/s3_spec.rb:84
20) Backup::Storage::Dropbox#transfer!
Failure/Error: Backup::Logger.expects(:message).with("Backup::Storage::Dropbox started transferring \"#{ Backup::TIME }.#{ Backup::TRIGGER }.tar\".")
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: Backup::Logger.message('Backup::Storage::Dropbox started transferring \'2011.05.05.16.49.56.myapp.tar\'.')
satisfied expectations:
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
- allowed any number of times, not yet invoked: #<Mock:Dropbox::Session>.delete(any_parameters)
- allowed any number of times, invoked once: #<Mock:Dropbox::Session>.upload(any_parameters)
- allowed any number of times, invoked once: #<Backup::Storage::Dropbox:0xb69c3694>.connection(any_parameters)
# ./spec/storage/dropbox_spec.rb:80
21) Backup::Storage::Dropbox#transfer!
Failure/Error: connection.expects(:upload).with(
not all expectations were satisfied
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Dropbox::Session>.upload('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar', 'backups/myapp', {:timeout => 500})
satisfied expectations:
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
- allowed any number of times, not yet invoked: #<Mock:Dropbox::Session>.delete(any_parameters)
- allowed any number of times, invoked once: #<Mock:Dropbox::Session>.upload(any_parameters)
- allowed any number of times, invoked once: #<Backup::Storage::Dropbox:0xb69b9734>.connection(any_parameters)
# ./spec/storage/dropbox_spec.rb:85
22) Backup::Storage::Dropbox#remove!
Failure/Error: db.send(:remove!)
unexpected invocation: #<Mock:Dropbox::Session>.delete('backups/myapp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Dropbox::Session>.delete('backups/myapp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked once: #<Backup::Storage::Dropbox:0xb69afc20>.connection(any_parameters)
# ./lib/backup/storage/dropbox.rb:83:in `remove!'
# ./spec/storage/dropbox_spec.rb:101:in `send'
# ./spec/storage/dropbox_spec.rb:101
23) Backup::Storage::CloudFiles#transfer! should transfer the provided file to the container
Failure/Error: cf.send(:transfer!)
unexpected invocation: File.open('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Fog::Storage>.put_object('my_container', 'backups/myapp/2011.05.05.16.49.56.myapp.tar', #<Mock:Backup::Storage::CloudFiles::File>)
- expected exactly once, not yet invoked: File.open('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked once: Fog::Storage.new(any_parameters)
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
- expected exactly twice, invoked twice: #<Backup::Storage::CloudFiles:0xb699891c>.remote_file(any_parameters)
# ./lib/backup/storage/cloudfiles.rb:76:in `transfer!'
# ./spec/storage/cloudfiles_spec.rb:77:in `send'
# ./spec/storage/cloudfiles_spec.rb:77
24) Backup::Storage::SCP#transfer! should transfer the provided file to the path
Failure/Error: scp.send(:transfer!)
unexpected invocation: #<Mock:Net::SSH::SCP>.upload!('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar.gz', 'backups/myapp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Net::SSH::SCP>.upload!('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar', 'backups/myapp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked once: Net::SSH.start(any_parameters)
- expected exactly once, invoked once: #<Mock:Net::SCP>.scp(any_parameters)
- expected exactly once, invoked once: #<Backup::Storage::SCP:0xb6977014>.create_remote_directories!(any_parameters)
- allowed any number of times, not yet invoked: #<Backup::Storage::SCP:0xb6977014>.create_remote_directories!(any_parameters)
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
# ./lib/backup/storage/scp.rb:74:in `transfer!'
# ./spec/storage/scp_spec.rb:85:in `send'
# ./spec/storage/scp_spec.rb:85
25) Backup::Storage::SCP#remove! should remove the file from the remote server path
Failure/Error: scp.send(:remove!)
unexpected invocation: #<Mock:Net::SCP>.exec!('rm backups/myapp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Net::SCP>.exec!('rm backups/myapp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked once: Net::SSH.start(any_parameters)
# ./lib/backup/storage/scp.rb:83:in `remove!'
# ./spec/storage/scp_spec.rb:98:in `send'
# ./spec/storage/scp_spec.rb:98
26) Backup::Storage::RSync#transfer! should transfer the provided file to the path
Failure/Error: rsync.send(:transfer!)
unexpected invocation: #<Backup::Storage::RSync:0xb6944aec>.run('rsync -z --port='22' --password-file='/tmp/backup-rsync-password20110505-634-s6dtmr-0' '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar.gz' 'my_username@123.45.678.90:backups/myapp/myapp.tar.gz'')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Backup::Storage::RSync:0xb6944aec>.run('rsync -z --port='22' --password-file='/tmp/backup-rsync-password20110505-634-s6dtmr-0' '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar' 'my_username@123.45.678.90:backups/myapp/myapp.tar'')
satisfied expectations:
- allowed any number of times, not yet invoked: Net::SSH.start(any_parameters)
- expected exactly once, invoked once: #<Backup::Storage::RSync:0xb6944aec>.utility(any_parameters)
- expected exactly once, invoked once: #<Backup::Storage::RSync:0xb6944aec>.create_remote_directories!(any_parameters)
- allowed any number of times, not yet invoked: #<Backup::Storage::RSync:0xb6944aec>.create_remote_directories!(any_parameters)
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
# ./lib/backup/storage/rsync.rb:75:in `transfer!'
# ./spec/storage/rsync_spec.rb:81:in `send'
# ./spec/storage/rsync_spec.rb:81
27) Backup::Storage::RSync#transfer! should not provide the --password-file option
Failure/Error: rsync.send(:transfer!)
unexpected invocation: #<Backup::Storage::RSync:0xb6933fbc>.run('rsync -z --port='22' '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar.gz' 'my_username@123.45.678.90:backups/myapp/myapp.tar.gz'')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Backup::Storage::RSync:0xb6933fbc>.run('rsync -z --port='22' '/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar' 'my_username@123.45.678.90:backups/myapp/myapp.tar'')
satisfied expectations:
- allowed any number of times, not yet invoked: Net::SSH.start(any_parameters)
- expected exactly once, invoked once: #<Backup::Storage::RSync:0xb6933fbc>.utility(any_parameters)
- expected exactly once, invoked once: #<Backup::Storage::RSync:0xb6933fbc>.create_remote_directories!(any_parameters)
- allowed any number of times, not yet invoked: #<Backup::Storage::RSync:0xb6933fbc>.create_remote_directories!(any_parameters)
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
# ./lib/backup/storage/rsync.rb:75:in `transfer!'
# ./spec/storage/rsync_spec.rb:93:in `send'
# ./spec/storage/rsync_spec.rb:93
28) Backup::Storage::RSync#remove! should remove the file from the remote server path
Failure/Error: rsync.send(:remove!)
unexpected invocation: #<Mock:Net::SCP>.exec!('rm backups/myapp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Net::SCP>.exec!('rm backups/myapp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked once: Net::SSH.start(any_parameters)
# ./lib/backup/storage/rsync.rb:81:in `remove!'
# ./spec/storage/rsync_spec.rb:106:in `send'
# ./spec/storage/rsync_spec.rb:106
29) Backup::Storage::FTP#transfer! should transfer the provided file to the path
Failure/Error: ftp.send(:transfer!)
unexpected invocation: #<Mock:Fog::Storage>.put('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar.gz', 'backups/myapp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Fog::Storage>.put('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar', 'backups/myapp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked once: Net::FTP.new(any_parameters)
- expected exactly once, invoked once: #<Backup::Storage::FTP:0xb68cd49c>.create_remote_directories!(any_parameters)
- allowed any number of times, not yet invoked: #<Backup::Storage::FTP:0xb68cd49c>.create_remote_directories!(any_parameters)
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
# ./lib/backup/storage/ftp.rb:77:in `transfer!'
# ./spec/storage/ftp_spec.rb:88:in `send'
# ./spec/storage/ftp_spec.rb:88
30) Backup::Storage::FTP#remove! should remove the file from the remote server path
Failure/Error: ftp.send(:remove!)
unexpected invocation: #<Mock:Net::FTP>.delete('backups/myapp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Net::FTP>.delete('backups/myapp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked once: Net::FTP.new(any_parameters)
# ./lib/backup/storage/ftp.rb:87:in `remove!'
# ./spec/storage/ftp_spec.rb:101:in `send'
# ./spec/storage/ftp_spec.rb:101
31) Backup::Storage::SFTP#transfer! should transfer the provided file to the path
Failure/Error: sftp.send(:transfer!)
unexpected invocation: #<Mock:Fog::Storage>.upload!('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar.gz', 'backups/myapp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Fog::Storage>.upload!('/home/tomek/Backup/.tmp/2011.05.05.16.49.56.myapp.tar', 'backups/myapp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked once: Net::SFTP.start(any_parameters)
- expected exactly once, invoked once: #<Backup::Storage::SFTP:0xb689b67c>.create_remote_directories!(any_parameters)
- allowed any number of times, not yet invoked: #<Backup::Storage::SFTP:0xb689b67c>.create_remote_directories!(any_parameters)
- allowed any number of times, invoked once: Backup::Logger.message(any_parameters)
# ./lib/backup/storage/sftp.rb:69:in `transfer!'
# ./spec/storage/sftp_spec.rb:81:in `send'
# ./spec/storage/sftp_spec.rb:81
32) Backup::Storage::SFTP#remove! should remove the file from the remote server path
Failure/Error: sftp.send(:remove!)
unexpected invocation: #<Mock:Net::SFTP>.remove!('backups/myapp/2011.05.05.16.49.56.myapp.tar.gz')
unsatisfied expectations:
- expected exactly once, not yet invoked: #<Mock:Net::SFTP>.remove!('backups/myapp/2011.05.05.16.49.56.myapp.tar')
satisfied expectations:
- allowed any number of times, invoked once: Net::SFTP.start(any_parameters)
# ./lib/backup/storage/sftp.rb:79:in `remove!'
# ./spec/storage/sftp_spec.rb:94:in `send'
# ./spec/storage/sftp_spec.rb:94
285/285: 100% |=============================================================================================================| Time: 00:00:00
Finished in 0.96838 seconds
285 examples, 32 failures
# running one-by one doesn't fail, though (!) :
tomek@asus-laptop:~/ruby_apps/backup$ bundle exec rspec spec/
archive_spec.rb compressor/ database/ logger_spec.rb notifier/ storage/ version_spec.rb
backup_spec.rb configuration/ encryptor/ model_spec.rb spec_helper.rb syncer/
tomek@asus-laptop:~/ruby_apps/backup$ bundle exec rspec spec/compressor/
6/6: 100% |=============================================================================================================| Time: 00:00:00
Finished in 0.01037 seconds
6 examples, 0 failures
tomek@asus-laptop:~/ruby_apps/backup$ bundle exec rspec spec/configuration
35/35: 100% |=============================================================================================================| Time: 00:00:00
Finished in 0.02363 seconds
35 examples, 0 failures
tomek@asus-laptop:~/ruby_apps/backup$ bundle exec rspec spec/encryptor
17/17: 100% |=============================================================================================================| Time: 00:00:00
Finished in 0.02165 seconds
17 examples, 0 failures
tomek@asus-laptop:~/ruby_apps/backup$ bundle exec rspec spec/storage
63/63: 100% |=============================================================================================================| Time: 00:00:00
Finished in 0.18973 seconds
63 examples, 0 failures
tomek@asus-laptop:~/ruby_apps/backup$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment