imap-backup 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec-all +2 -0
- data/.rubocop.yml +10 -1
- data/.travis.yml +1 -0
- data/README.md +1 -1
- data/Rakefile +0 -1
- data/bin/imap-backup +3 -9
- data/imap-backup.gemspec +5 -5
- data/lib/email/mboxrd/message.rb +2 -2
- data/lib/imap/backup/account/connection.rb +11 -3
- data/lib/imap/backup/account/folder.rb +11 -6
- data/lib/imap/backup/configuration/account.rb +7 -7
- data/lib/imap/backup/configuration/asker.rb +2 -1
- data/lib/imap/backup/configuration/connection_tester.rb +1 -1
- data/lib/imap/backup/configuration/folder_chooser.rb +32 -5
- data/lib/imap/backup/configuration/list.rb +2 -0
- data/lib/imap/backup/configuration/setup.rb +2 -1
- data/lib/imap/backup/configuration/store.rb +3 -6
- data/lib/imap/backup/downloader.rb +8 -7
- data/lib/imap/backup/serializer/mbox.rb +2 -1
- data/lib/imap/backup/serializer/mbox_store.rb +14 -6
- data/lib/imap/backup/uploader.rb +1 -0
- data/lib/imap/backup/utils.rb +11 -9
- data/lib/imap/backup/version.rb +1 -1
- data/spec/features/backup_spec.rb +6 -5
- data/spec/features/support/backup_directory.rb +5 -5
- data/spec/features/support/email_server.rb +11 -8
- data/spec/features/support/shared/connection_context.rb +2 -2
- data/spec/support/fixtures.rb +1 -1
- data/spec/support/higline_test_helpers.rb +1 -1
- data/spec/unit/email/mboxrd/message_spec.rb +51 -42
- data/spec/unit/email/provider_spec.rb +0 -2
- data/spec/unit/imap/backup/account/connection_spec.rb +18 -11
- data/spec/unit/imap/backup/account/folder_spec.rb +26 -12
- data/spec/unit/imap/backup/configuration/account_spec.rb +22 -19
- data/spec/unit/imap/backup/configuration/asker_spec.rb +30 -31
- data/spec/unit/imap/backup/configuration/connection_tester_spec.rb +16 -13
- data/spec/unit/imap/backup/configuration/folder_chooser_spec.rb +45 -18
- data/spec/unit/imap/backup/configuration/list_spec.rb +8 -13
- data/spec/unit/imap/backup/configuration/setup_spec.rb +36 -30
- data/spec/unit/imap/backup/configuration/store_spec.rb +7 -4
- data/spec/unit/imap/backup/downloader_spec.rb +11 -7
- data/spec/unit/imap/backup/serializer/mbox_spec.rb +2 -5
- data/spec/unit/imap/backup/serializer/mbox_store_spec.rb +4 -4
- data/spec/unit/imap/backup/uploader_spec.rb +0 -2
- data/spec/unit/imap/backup/utils_spec.rb +1 -3
- metadata +6 -6
@@ -1,4 +1,6 @@
|
|
1
1
|
describe Imap::Backup::Serializer::Mbox do
|
2
|
+
subject { described_class.new(base_path, imap_folder) }
|
3
|
+
|
2
4
|
let(:base_path) { "/base/path" }
|
3
5
|
let(:store) do
|
4
6
|
instance_double(
|
@@ -20,11 +22,6 @@ describe Imap::Backup::Serializer::Mbox do
|
|
20
22
|
allow(Imap::Backup::Utils).to receive(:mode) { permissions }
|
21
23
|
allow(Imap::Backup::Utils).to receive(:check_permissions) { true }
|
22
24
|
allow(File).to receive(:directory?) { dir_exists }
|
23
|
-
end
|
24
|
-
|
25
|
-
subject { described_class.new(base_path, imap_folder) }
|
26
|
-
|
27
|
-
before do
|
28
25
|
allow(FileUtils).to receive(:chmod)
|
29
26
|
allow(Imap::Backup::Serializer::MboxStore).to receive(:new) { store }
|
30
27
|
end
|
@@ -1,13 +1,15 @@
|
|
1
1
|
describe Imap::Backup::Serializer::MboxStore do
|
2
|
+
subject { described_class.new(base_path, folder) }
|
3
|
+
|
2
4
|
let(:base_path) { "/base/path" }
|
3
5
|
let(:folder) { "the/folder" }
|
4
6
|
let(:folder_path) { File.join(base_path, folder) }
|
5
7
|
let(:imap_pathname) { folder_path + ".imap" }
|
6
8
|
let(:imap_exists) { true }
|
7
|
-
let(:imap_file) {
|
9
|
+
let(:imap_file) { instance_double(File, write: nil, close: nil) }
|
8
10
|
let(:mbox_pathname) { folder_path + ".mbox" }
|
9
11
|
let(:mbox_exists) { true }
|
10
|
-
let(:mbox_file) {
|
12
|
+
let(:mbox_file) { instance_double(File, write: nil, close: nil) }
|
11
13
|
let(:uids) { [3, 2, 1] }
|
12
14
|
let(:imap_content) do
|
13
15
|
{
|
@@ -17,8 +19,6 @@ describe Imap::Backup::Serializer::MboxStore do
|
|
17
19
|
}.to_json
|
18
20
|
end
|
19
21
|
|
20
|
-
subject { described_class.new(base_path, folder) }
|
21
|
-
|
22
22
|
before do
|
23
23
|
allow(File).to receive(:exist?).and_call_original
|
24
24
|
allow(File).to receive(:exist?).with(imap_pathname) { imap_exists }
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imap-backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: highline
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: mail
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -208,7 +208,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
208
208
|
requirements:
|
209
209
|
- - ">="
|
210
210
|
- !ruby/object:Gem::Version
|
211
|
-
version: 2.
|
211
|
+
version: 2.3.0
|
212
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
213
|
requirements:
|
214
214
|
- - ">="
|