backup 3.0.23 → 3.0.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. data/Gemfile.lock +42 -45
  2. data/Guardfile +7 -4
  3. data/README.md +10 -7
  4. data/backup.gemspec +2 -2
  5. data/lib/backup.rb +27 -97
  6. data/lib/backup/archive.rb +14 -6
  7. data/lib/backup/cli/helpers.rb +52 -49
  8. data/lib/backup/cli/utility.rb +9 -1
  9. data/lib/backup/compressor/base.rb +10 -4
  10. data/lib/backup/compressor/bzip2.rb +22 -26
  11. data/lib/backup/compressor/custom.rb +53 -0
  12. data/lib/backup/compressor/gzip.rb +22 -23
  13. data/lib/backup/compressor/lzma.rb +15 -13
  14. data/lib/backup/compressor/pbzip2.rb +20 -17
  15. data/lib/backup/config.rb +6 -3
  16. data/lib/backup/configuration.rb +33 -0
  17. data/lib/backup/configuration/helpers.rb +114 -28
  18. data/lib/backup/configuration/store.rb +24 -0
  19. data/lib/backup/database/base.rb +0 -6
  20. data/lib/backup/database/mongodb.rb +27 -11
  21. data/lib/backup/database/mysql.rb +19 -14
  22. data/lib/backup/database/postgresql.rb +16 -11
  23. data/lib/backup/database/redis.rb +7 -11
  24. data/lib/backup/database/riak.rb +3 -6
  25. data/lib/backup/dependency.rb +5 -11
  26. data/lib/backup/model.rb +14 -5
  27. data/lib/backup/notifier/campfire.rb +3 -16
  28. data/lib/backup/notifier/hipchat.rb +1 -7
  29. data/lib/backup/notifier/mail.rb +1 -1
  30. data/lib/backup/packager.rb +29 -19
  31. data/lib/backup/pipeline.rb +110 -0
  32. data/lib/backup/storage/dropbox.rb +4 -7
  33. data/lib/backup/syncer/base.rb +8 -4
  34. data/lib/backup/syncer/cloud/base.rb +247 -0
  35. data/lib/backup/syncer/cloud/cloud_files.rb +78 -0
  36. data/lib/backup/syncer/cloud/s3.rb +68 -0
  37. data/lib/backup/syncer/rsync/base.rb +1 -4
  38. data/lib/backup/syncer/rsync/local.rb +9 -5
  39. data/lib/backup/syncer/rsync/pull.rb +1 -1
  40. data/lib/backup/syncer/rsync/push.rb +10 -5
  41. data/lib/backup/version.rb +1 -1
  42. data/spec-live/.gitignore +6 -0
  43. data/spec-live/README +7 -0
  44. data/spec-live/backups/config.rb +153 -0
  45. data/spec-live/backups/config.yml.template +43 -0
  46. data/spec-live/compressor/custom_spec.rb +30 -0
  47. data/spec-live/compressor/gzip_spec.rb +30 -0
  48. data/spec-live/notifier/mail_spec.rb +85 -0
  49. data/spec-live/spec_helper.rb +85 -0
  50. data/spec-live/storage/dropbox_spec.rb +151 -0
  51. data/spec-live/storage/local_spec.rb +83 -0
  52. data/spec-live/storage/scp_spec.rb +193 -0
  53. data/spec-live/syncer/cloud/s3_spec.rb +124 -0
  54. data/spec/archive_spec.rb +86 -31
  55. data/spec/cleaner_spec.rb +8 -0
  56. data/spec/cli/helpers_spec.rb +200 -75
  57. data/spec/cli/utility_spec.rb +11 -3
  58. data/spec/compressor/base_spec.rb +31 -10
  59. data/spec/compressor/bzip2_spec.rb +212 -57
  60. data/spec/compressor/custom_spec.rb +106 -0
  61. data/spec/compressor/gzip_spec.rb +212 -57
  62. data/spec/compressor/lzma_spec.rb +75 -35
  63. data/spec/compressor/pbzip2_spec.rb +93 -52
  64. data/spec/configuration/helpers_spec.rb +406 -0
  65. data/spec/configuration/store_spec.rb +39 -0
  66. data/spec/configuration_spec.rb +62 -0
  67. data/spec/database/base_spec.rb +19 -10
  68. data/spec/database/mongodb_spec.rb +195 -70
  69. data/spec/database/mysql_spec.rb +183 -64
  70. data/spec/database/postgresql_spec.rb +167 -53
  71. data/spec/database/redis_spec.rb +121 -46
  72. data/spec/database/riak_spec.rb +96 -27
  73. data/spec/dependency_spec.rb +2 -0
  74. data/spec/encryptor/base_spec.rb +10 -0
  75. data/spec/encryptor/gpg_spec.rb +29 -13
  76. data/spec/encryptor/open_ssl_spec.rb +40 -21
  77. data/spec/logger_spec.rb +4 -0
  78. data/spec/model_spec.rb +19 -2
  79. data/spec/notifier/base_spec.rb +32 -17
  80. data/spec/notifier/campfire_spec.rb +63 -45
  81. data/spec/notifier/hipchat_spec.rb +79 -56
  82. data/spec/notifier/mail_spec.rb +82 -46
  83. data/spec/notifier/prowl_spec.rb +53 -32
  84. data/spec/notifier/twitter_spec.rb +62 -41
  85. data/spec/packager_spec.rb +95 -36
  86. data/spec/pipeline_spec.rb +259 -0
  87. data/spec/spec_helper.rb +6 -5
  88. data/spec/storage/base_spec.rb +61 -41
  89. data/spec/storage/cloudfiles_spec.rb +69 -45
  90. data/spec/storage/dropbox_spec.rb +158 -36
  91. data/spec/storage/ftp_spec.rb +69 -45
  92. data/spec/storage/local_spec.rb +47 -23
  93. data/spec/storage/ninefold_spec.rb +55 -31
  94. data/spec/storage/rsync_spec.rb +67 -50
  95. data/spec/storage/s3_spec.rb +65 -41
  96. data/spec/storage/scp_spec.rb +65 -41
  97. data/spec/storage/sftp_spec.rb +65 -41
  98. data/spec/syncer/base_spec.rb +91 -4
  99. data/spec/syncer/cloud/base_spec.rb +511 -0
  100. data/spec/syncer/cloud/cloud_files_spec.rb +181 -0
  101. data/spec/syncer/cloud/s3_spec.rb +174 -0
  102. data/spec/syncer/rsync/base_spec.rb +46 -66
  103. data/spec/syncer/rsync/local_spec.rb +55 -26
  104. data/spec/syncer/rsync/pull_spec.rb +15 -4
  105. data/spec/syncer/rsync/push_spec.rb +59 -52
  106. data/templates/cli/utility/compressor/bzip2 +1 -4
  107. data/templates/cli/utility/compressor/custom +11 -0
  108. data/templates/cli/utility/compressor/gzip +1 -4
  109. data/templates/cli/utility/compressor/lzma +3 -0
  110. data/templates/cli/utility/compressor/pbzip2 +3 -0
  111. data/templates/cli/utility/database/mysql +4 -1
  112. data/templates/cli/utility/syncer/cloud_files +17 -19
  113. data/templates/cli/utility/syncer/s3 +18 -20
  114. metadata +38 -92
  115. data/lib/backup/configuration/base.rb +0 -15
  116. data/lib/backup/configuration/compressor/base.rb +0 -9
  117. data/lib/backup/configuration/compressor/bzip2.rb +0 -23
  118. data/lib/backup/configuration/compressor/gzip.rb +0 -23
  119. data/lib/backup/configuration/compressor/lzma.rb +0 -23
  120. data/lib/backup/configuration/compressor/pbzip2.rb +0 -28
  121. data/lib/backup/configuration/database/base.rb +0 -19
  122. data/lib/backup/configuration/database/mongodb.rb +0 -49
  123. data/lib/backup/configuration/database/mysql.rb +0 -42
  124. data/lib/backup/configuration/database/postgresql.rb +0 -41
  125. data/lib/backup/configuration/database/redis.rb +0 -39
  126. data/lib/backup/configuration/database/riak.rb +0 -29
  127. data/lib/backup/configuration/encryptor/base.rb +0 -9
  128. data/lib/backup/configuration/encryptor/gpg.rb +0 -17
  129. data/lib/backup/configuration/encryptor/open_ssl.rb +0 -32
  130. data/lib/backup/configuration/notifier/base.rb +0 -28
  131. data/lib/backup/configuration/notifier/campfire.rb +0 -25
  132. data/lib/backup/configuration/notifier/hipchat.rb +0 -41
  133. data/lib/backup/configuration/notifier/mail.rb +0 -112
  134. data/lib/backup/configuration/notifier/presently.rb +0 -25
  135. data/lib/backup/configuration/notifier/prowl.rb +0 -23
  136. data/lib/backup/configuration/notifier/twitter.rb +0 -21
  137. data/lib/backup/configuration/storage/base.rb +0 -18
  138. data/lib/backup/configuration/storage/cloudfiles.rb +0 -25
  139. data/lib/backup/configuration/storage/dropbox.rb +0 -58
  140. data/lib/backup/configuration/storage/ftp.rb +0 -29
  141. data/lib/backup/configuration/storage/local.rb +0 -17
  142. data/lib/backup/configuration/storage/ninefold.rb +0 -20
  143. data/lib/backup/configuration/storage/rsync.rb +0 -29
  144. data/lib/backup/configuration/storage/s3.rb +0 -25
  145. data/lib/backup/configuration/storage/scp.rb +0 -25
  146. data/lib/backup/configuration/storage/sftp.rb +0 -25
  147. data/lib/backup/configuration/syncer/base.rb +0 -10
  148. data/lib/backup/configuration/syncer/cloud.rb +0 -23
  149. data/lib/backup/configuration/syncer/cloud_files.rb +0 -30
  150. data/lib/backup/configuration/syncer/rsync/base.rb +0 -28
  151. data/lib/backup/configuration/syncer/rsync/local.rb +0 -11
  152. data/lib/backup/configuration/syncer/rsync/pull.rb +0 -11
  153. data/lib/backup/configuration/syncer/rsync/push.rb +0 -31
  154. data/lib/backup/configuration/syncer/s3.rb +0 -23
  155. data/lib/backup/notifier/presently.rb +0 -88
  156. data/lib/backup/syncer/cloud.rb +0 -187
  157. data/lib/backup/syncer/cloud_files.rb +0 -56
  158. data/lib/backup/syncer/s3.rb +0 -47
  159. data/spec/configuration/base_spec.rb +0 -35
  160. data/spec/configuration/compressor/bzip2_spec.rb +0 -29
  161. data/spec/configuration/compressor/gzip_spec.rb +0 -29
  162. data/spec/configuration/compressor/lzma_spec.rb +0 -29
  163. data/spec/configuration/compressor/pbzip2_spec.rb +0 -32
  164. data/spec/configuration/database/base_spec.rb +0 -17
  165. data/spec/configuration/database/mongodb_spec.rb +0 -56
  166. data/spec/configuration/database/mysql_spec.rb +0 -53
  167. data/spec/configuration/database/postgresql_spec.rb +0 -53
  168. data/spec/configuration/database/redis_spec.rb +0 -50
  169. data/spec/configuration/database/riak_spec.rb +0 -35
  170. data/spec/configuration/encryptor/gpg_spec.rb +0 -26
  171. data/spec/configuration/encryptor/open_ssl_spec.rb +0 -35
  172. data/spec/configuration/notifier/base_spec.rb +0 -32
  173. data/spec/configuration/notifier/campfire_spec.rb +0 -32
  174. data/spec/configuration/notifier/hipchat_spec.rb +0 -44
  175. data/spec/configuration/notifier/mail_spec.rb +0 -71
  176. data/spec/configuration/notifier/presently_spec.rb +0 -35
  177. data/spec/configuration/notifier/prowl_spec.rb +0 -29
  178. data/spec/configuration/notifier/twitter_spec.rb +0 -35
  179. data/spec/configuration/storage/cloudfiles_spec.rb +0 -41
  180. data/spec/configuration/storage/dropbox_spec.rb +0 -38
  181. data/spec/configuration/storage/ftp_spec.rb +0 -44
  182. data/spec/configuration/storage/local_spec.rb +0 -29
  183. data/spec/configuration/storage/ninefold_spec.rb +0 -32
  184. data/spec/configuration/storage/rsync_spec.rb +0 -41
  185. data/spec/configuration/storage/s3_spec.rb +0 -38
  186. data/spec/configuration/storage/scp_spec.rb +0 -41
  187. data/spec/configuration/storage/sftp_spec.rb +0 -41
  188. data/spec/configuration/syncer/cloud_files_spec.rb +0 -44
  189. data/spec/configuration/syncer/rsync/base_spec.rb +0 -33
  190. data/spec/configuration/syncer/rsync/local_spec.rb +0 -10
  191. data/spec/configuration/syncer/rsync/pull_spec.rb +0 -10
  192. data/spec/configuration/syncer/rsync/push_spec.rb +0 -43
  193. data/spec/configuration/syncer/s3_spec.rb +0 -38
  194. data/spec/notifier/presently_spec.rb +0 -181
  195. data/spec/syncer/cloud_files_spec.rb +0 -192
  196. data/spec/syncer/s3_spec.rb +0 -192
  197. data/templates/cli/utility/notifier/presently +0 -13
@@ -1,35 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Helpers do
6
-
7
- before do
8
- class Backup::Configuration::Base
9
- class << self
10
- attr_accessor :rspec_method, :rspec_test, :rspec_mocha
11
- end
12
- end
13
- end
14
-
15
- it 'should clear the defaults' do
16
- Backup::Configuration::Base.expects(:send).with('rspec_method=', nil)
17
- Backup::Configuration::Base.expects(:send).with('rspec_test=', nil)
18
- Backup::Configuration::Base.expects(:send).with('rspec_mocha=', nil)
19
- Backup::Configuration::Base.clear_defaults!
20
- end
21
-
22
- it 'should return the setters' do
23
- Backup::Configuration::Base.send(:setter_methods).count.should == 3
24
- %w[rspec_method= rspec_test= rspec_mocha=].each do |method|
25
- Backup::Configuration::Base.send(:setter_methods).should include(method)
26
- end
27
- end
28
-
29
- it 'should return the getters' do
30
- Backup::Configuration::Base.send(:getter_methods).count.should == 3
31
- %w[rspec_method rspec_test rspec_mocha].each do |method|
32
- Backup::Configuration::Base.send(:getter_methods).should include(method)
33
- end
34
- end
35
- end
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Compressor::Bzip2 do
6
- before do
7
- Backup::Configuration::Compressor::Bzip2.defaults do |compressor|
8
- compressor.best = true
9
- compressor.fast = true
10
- end
11
- end
12
- after { Backup::Configuration::Compressor::Bzip2.clear_defaults! }
13
-
14
- it 'should set the default compressor configuration' do
15
- compressor = Backup::Configuration::Compressor::Bzip2
16
- compressor.best.should == true
17
- compressor.fast.should == true
18
- end
19
-
20
- describe '#clear_defaults!' do
21
- it 'should clear all the defaults, resetting them to nil' do
22
- Backup::Configuration::Compressor::Bzip2.clear_defaults!
23
-
24
- compressor = Backup::Configuration::Compressor::Bzip2
25
- compressor.best.should == nil
26
- compressor.fast.should == nil
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Compressor::Gzip do
6
- before do
7
- Backup::Configuration::Compressor::Gzip.defaults do |compressor|
8
- compressor.best = true
9
- compressor.fast = true
10
- end
11
- end
12
- after { Backup::Configuration::Compressor::Gzip.clear_defaults! }
13
-
14
- it 'should set the default compressor configuration' do
15
- compressor = Backup::Configuration::Compressor::Gzip
16
- compressor.best.should == true
17
- compressor.fast.should == true
18
- end
19
-
20
- describe '#clear_defaults!' do
21
- it 'should clear all the defaults, resetting them to nil' do
22
- Backup::Configuration::Compressor::Gzip.clear_defaults!
23
-
24
- compressor = Backup::Configuration::Compressor::Gzip
25
- compressor.best.should == nil
26
- compressor.fast.should == nil
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Compressor::Lzma do
6
- before do
7
- Backup::Configuration::Compressor::Lzma.defaults do |compressor|
8
- compressor.best = true
9
- compressor.fast = true
10
- end
11
- end
12
- after { Backup::Configuration::Compressor::Lzma.clear_defaults! }
13
-
14
- it 'should set the default compressor configuration' do
15
- compressor = Backup::Configuration::Compressor::Lzma
16
- compressor.best.should == true
17
- compressor.fast.should == true
18
- end
19
-
20
- describe '#clear_defaults!' do
21
- it 'should clear all the defaults, resetting them to nil' do
22
- Backup::Configuration::Compressor::Lzma.clear_defaults!
23
-
24
- compressor = Backup::Configuration::Compressor::Lzma
25
- compressor.best.should == nil
26
- compressor.fast.should == nil
27
- end
28
- end
29
- end
@@ -1,32 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Compressor::Pbzip2 do
6
- before do
7
- Backup::Configuration::Compressor::Pbzip2.defaults do |compressor|
8
- compressor.best = true
9
- compressor.fast = true
10
- compressor.processors = 2
11
- end
12
- end
13
- after { Backup::Configuration::Compressor::Pbzip2.clear_defaults! }
14
-
15
- it 'should set the default compressor configuration' do
16
- compressor = Backup::Configuration::Compressor::Pbzip2
17
- compressor.best.should == true
18
- compressor.fast.should == true
19
- compressor.processors.should == 2
20
- end
21
-
22
- describe '#clear_defaults!' do
23
- it 'should clear all the defaults, resetting them to nil' do
24
- Backup::Configuration::Compressor::Pbzip2.clear_defaults!
25
-
26
- compressor = Backup::Configuration::Compressor::Pbzip2
27
- compressor.best.should == nil
28
- compressor.fast.should == nil
29
- compressor.processors.should == nil
30
- end
31
- end
32
- end
@@ -1,17 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Database::Base do
6
- before do
7
- Backup::Configuration::Database::Base.defaults do |db|
8
- db.utility_path = '/usr/bin/my_util' # deprecated
9
- end
10
- end
11
- after { Backup::Configuration::Database::Base.clear_defaults! }
12
-
13
- it 'should set the default Base configuration' do
14
- db = Backup::Configuration::Database::Base
15
- db.utility_path.should == '/usr/bin/my_util'
16
- end
17
- end
@@ -1,56 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Database::MongoDB do
6
- before do
7
- Backup::Configuration::Database::MongoDB.defaults do |db|
8
- db.name = 'mydb'
9
- db.username = 'myuser'
10
- db.password = 'mypassword'
11
- db.host = 'myhost'
12
- db.port = 'myport'
13
- db.only_collections = %w[my other tables]
14
- db.additional_options = %w[my options]
15
- db.ipv6 = true
16
- db.mongodump_utility = '/path/to/mongodump'
17
- db.mongo_utility = '/path/to/mongo'
18
- db.lock = true
19
- end
20
- end
21
- after { Backup::Configuration::Database::MongoDB.clear_defaults! }
22
-
23
- it 'should set the default MongoDB configuration' do
24
- db = Backup::Configuration::Database::MongoDB
25
- db.name.should == 'mydb'
26
- db.username.should == 'myuser'
27
- db.password.should == 'mypassword'
28
- db.host.should == 'myhost'
29
- db.port.should == 'myport'
30
- db.only_collections.should == %w[my other tables]
31
- db.additional_options.should == %w[my options]
32
- db.ipv6.should == true
33
- db.mongodump_utility.should == '/path/to/mongodump'
34
- db.mongo_utility.should == '/path/to/mongo'
35
- db.lock.should == true
36
- end
37
-
38
- describe '#clear_defaults!' do
39
- it 'should clear all the defaults, resetting them to nil' do
40
- Backup::Configuration::Database::MongoDB.clear_defaults!
41
-
42
- db = Backup::Configuration::Database::MongoDB
43
- db.name.should == nil
44
- db.username.should == nil
45
- db.password.should == nil
46
- db.host.should == nil
47
- db.port.should == nil
48
- db.only_collections.should == nil
49
- db.additional_options.should == nil
50
- db.ipv6.should == nil
51
- db.mongodump_utility.should == nil
52
- db.mongo_utility.should == nil
53
- db.lock.should == nil
54
- end
55
- end
56
- end
@@ -1,53 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Database::MySQL do
6
- before do
7
- Backup::Configuration::Database::MySQL.defaults do |db|
8
- db.name = 'mydb'
9
- db.username = 'myuser'
10
- db.password = 'mypassword'
11
- db.host = 'myhost'
12
- db.port = 'myport'
13
- db.socket = 'mysocket'
14
- db.skip_tables = %w[my tables]
15
- db.only_tables = %w[my other tables]
16
- db.additional_options = %w[my options]
17
- db.mysqldump_utility = '/path/to/mysqldump'
18
- end
19
- end
20
- after { Backup::Configuration::Database::MySQL.clear_defaults! }
21
-
22
- it 'should set the default MySQL configuration' do
23
- db = Backup::Configuration::Database::MySQL
24
- db.name.should == 'mydb'
25
- db.username.should == 'myuser'
26
- db.password.should == 'mypassword'
27
- db.host.should == 'myhost'
28
- db.port.should == 'myport'
29
- db.socket.should == 'mysocket'
30
- db.skip_tables.should == %w[my tables]
31
- db.only_tables.should == %w[my other tables]
32
- db.additional_options.should == %w[my options]
33
- db.mysqldump_utility.should == '/path/to/mysqldump'
34
- end
35
-
36
- describe '#clear_defaults!' do
37
- it 'should clear all the defaults, resetting them to nil' do
38
- Backup::Configuration::Database::MySQL.clear_defaults!
39
-
40
- db = Backup::Configuration::Database::MySQL
41
- db.name.should == nil
42
- db.username.should == nil
43
- db.password.should == nil
44
- db.host.should == nil
45
- db.port.should == nil
46
- db.socket.should == nil
47
- db.skip_tables.should == nil
48
- db.only_tables.should == nil
49
- db.additional_options.should == nil
50
- db.mysqldump_utility.should == nil
51
- end
52
- end
53
- end
@@ -1,53 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Database::PostgreSQL do
6
- before do
7
- Backup::Configuration::Database::PostgreSQL.defaults do |db|
8
- db.name = 'mydb'
9
- db.username = 'myuser'
10
- db.password = 'mypassword'
11
- db.host = 'myhost'
12
- db.port = 'myport'
13
- db.socket = 'mysocket'
14
- db.skip_tables = %w[my tables]
15
- db.only_tables = %w[my other tables]
16
- db.additional_options = %w[my options]
17
- db.pg_dump_utility = '/path/to/pg_dump'
18
- end
19
- end
20
- after { Backup::Configuration::Database::PostgreSQL.clear_defaults! }
21
-
22
- it 'should set the default PostgreSQL configuration' do
23
- db = Backup::Configuration::Database::PostgreSQL
24
- db.name.should == 'mydb'
25
- db.username.should == 'myuser'
26
- db.password.should == 'mypassword'
27
- db.host.should == 'myhost'
28
- db.port.should == 'myport'
29
- db.socket.should == 'mysocket'
30
- db.skip_tables.should == %w[my tables]
31
- db.only_tables.should == %w[my other tables]
32
- db.additional_options.should == %w[my options]
33
- db.pg_dump_utility.should == '/path/to/pg_dump'
34
- end
35
-
36
- describe '#clear_defaults!' do
37
- it 'should clear all the defaults, resetting them to nil' do
38
- Backup::Configuration::Database::PostgreSQL.clear_defaults!
39
-
40
- db = Backup::Configuration::Database::PostgreSQL
41
- db.name.should == nil
42
- db.username.should == nil
43
- db.password.should == nil
44
- db.host.should == nil
45
- db.port.should == nil
46
- db.socket.should == nil
47
- db.skip_tables.should == nil
48
- db.only_tables.should == nil
49
- db.additional_options.should == nil
50
- db.pg_dump_utility.should == nil
51
- end
52
- end
53
- end
@@ -1,50 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Database::Redis do
6
- before do
7
- Backup::Configuration::Database::Redis.defaults do |db|
8
- db.name = 'mydb'
9
- db.path = '/var/lib/redis/db'
10
- db.password = 'mypassword'
11
- db.invoke_save = true
12
- db.host = 'localhost'
13
- db.port = 123
14
- db.socket = '/redis.sock'
15
- db.additional_options = %w[my options]
16
- db.redis_cli_utility = '/path/to/redis-cli'
17
- end
18
- end
19
- after { Backup::Configuration::Database::Redis.clear_defaults! }
20
-
21
- it 'should set the default Redis configuration' do
22
- db = Backup::Configuration::Database::Redis
23
- db.name.should == 'mydb'
24
- db.path.should == '/var/lib/redis/db'
25
- db.password.should == 'mypassword'
26
- db.invoke_save.should == true
27
- db.host.should == 'localhost'
28
- db.port.should == 123
29
- db.socket.should == '/redis.sock'
30
- db.additional_options.should == %w[my options]
31
- db.redis_cli_utility.should == '/path/to/redis-cli'
32
- end
33
-
34
- describe '#clear_defaults!' do
35
- it 'should clear all the defaults, resetting them to nil' do
36
- Backup::Configuration::Database::Redis.clear_defaults!
37
-
38
- db = Backup::Configuration::Database::Redis
39
- db.name.should == nil
40
- db.path.should == nil
41
- db.password.should == nil
42
- db.invoke_save.should == nil
43
- db.host.should == nil
44
- db.port.should == nil
45
- db.socket.should == nil
46
- db.additional_options.should == nil
47
- db.redis_cli_utility.should == nil
48
- end
49
- end
50
- end
@@ -1,35 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Database::Riak do
6
- before do
7
- Backup::Configuration::Database::Riak.defaults do |db|
8
- db.name = 'mydb'
9
- db.node = '/var/lib/redis/db'
10
- db.cookie = 'mypassword'
11
- db.riak_admin_utility = '/path/to/riak-admin'
12
- end
13
- end
14
- after { Backup::Configuration::Database::Riak.clear_defaults! }
15
-
16
- it 'should set the default Riak configuration' do
17
- db = Backup::Configuration::Database::Riak
18
- db.name.should == 'mydb'
19
- db.node.should == '/var/lib/redis/db'
20
- db.cookie.should == 'mypassword'
21
- db.riak_admin_utility.should == '/path/to/riak-admin'
22
- end
23
-
24
- describe '#clear_defaults!' do
25
- it 'should clear all the defaults, resetting them to nil' do
26
- Backup::Configuration::Database::Riak.clear_defaults!
27
-
28
- db = Backup::Configuration::Database::Riak
29
- db.name.should == nil
30
- db.node.should == nil
31
- db.cookie.should == nil
32
- db.riak_admin_utility.should == nil
33
- end
34
- end
35
- end
@@ -1,26 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require File.expand_path('../../../spec_helper.rb', __FILE__)
4
-
5
- describe Backup::Configuration::Encryptor::GPG do
6
- before do
7
- Backup::Configuration::Encryptor::GPG.defaults do |encryptor|
8
- encryptor.key = 'my_key'
9
- end
10
- end
11
- after { Backup::Configuration::Encryptor::GPG.clear_defaults! }
12
-
13
- it 'should set the default encryptor configuration' do
14
- encryptor = Backup::Configuration::Encryptor::GPG
15
- encryptor.key.should == 'my_key'
16
- end
17
-
18
- describe '#clear_defaults!' do
19
- it 'should clear all the defaults, resetting them to nil' do
20
- Backup::Configuration::Encryptor::GPG.clear_defaults!
21
-
22
- encryptor = Backup::Configuration::Encryptor::GPG
23
- encryptor.key.should == nil
24
- end
25
- end
26
- end