imap-backup 4.1.1 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/imap/backup/cli/status.rb +1 -1
- data/lib/imap/backup/version.rb +1 -1
- data/spec/features/status_spec.rb +43 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00a744249ff80a26be2c57655709be59d9678c9bb998dc1c9f3ea4bf3539d747
|
4
|
+
data.tar.gz: 4f44c050c66fe2ef2e136b46dec581a91f77ab4b650e9b3466a893540e481a24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66067924fda33810aff4b02aa047c20cd26ce3fc31d8e752fc43a8f78af3e1c952871fa0ba372c670a5ee399e7fc686f9df9601fc5cbb7caa6f2065b4ac95b90
|
7
|
+
data.tar.gz: 443a86c3bda9cc1652fc9d1c5619347c1d82498befed16851a6f8a227eaf3299813dd6a4084e1bb0d180170adb1b63ccf8e5d2a8bb19f0457611e7916d796c4d
|
@@ -13,7 +13,7 @@ module Imap::Backup
|
|
13
13
|
no_commands do
|
14
14
|
def run
|
15
15
|
each_connection(account_names) do |connection|
|
16
|
-
puts connection.username
|
16
|
+
puts connection.account.username
|
17
17
|
folders = connection.status
|
18
18
|
folders.each do |f|
|
19
19
|
missing_locally = f[:remote] - f[:local]
|
data/lib/imap/backup/version.rb
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
require "features/helper"
|
2
|
+
require "imap/backup/cli/status"
|
3
|
+
|
4
|
+
RSpec.describe "status", type: :feature, docker: true do
|
5
|
+
include_context "imap-backup connection"
|
6
|
+
include_context "message-fixtures"
|
7
|
+
|
8
|
+
context "when there are non-backed-up messages" do
|
9
|
+
let(:options) do
|
10
|
+
{accounts: "address@example.org"}
|
11
|
+
end
|
12
|
+
let(:folder) { "my-stuff" }
|
13
|
+
let(:backup_folders) { [{name: folder}] }
|
14
|
+
let(:email1) { send_email folder, msg1 }
|
15
|
+
let(:output) { StringIO.new }
|
16
|
+
|
17
|
+
before do
|
18
|
+
allow(Imap::Backup::CLI::Accounts).to receive(:new) { [account] }
|
19
|
+
server_create_folder folder
|
20
|
+
email1
|
21
|
+
end
|
22
|
+
|
23
|
+
around do |example|
|
24
|
+
stdout = $stdout
|
25
|
+
$stdout = output
|
26
|
+
example.run
|
27
|
+
$stdout = stdout
|
28
|
+
end
|
29
|
+
|
30
|
+
after do
|
31
|
+
FileUtils.rm_rf local_backup_path
|
32
|
+
delete_emails folder
|
33
|
+
server_delete_folder folder
|
34
|
+
connection.disconnect
|
35
|
+
end
|
36
|
+
|
37
|
+
it "prints the number" do
|
38
|
+
Imap::Backup::CLI::Status.new(options).run
|
39
|
+
|
40
|
+
expect(output.string).to eq("address@example.org\nmy-stuff: 1\n")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imap-backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Yates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -231,6 +231,7 @@ files:
|
|
231
231
|
- spec/features/backup_spec.rb
|
232
232
|
- spec/features/helper.rb
|
233
233
|
- spec/features/restore_spec.rb
|
234
|
+
- spec/features/status_spec.rb
|
234
235
|
- spec/features/support/backup_directory.rb
|
235
236
|
- spec/features/support/email_server.rb
|
236
237
|
- spec/features/support/shared/connection_context.rb
|
@@ -296,6 +297,7 @@ test_files:
|
|
296
297
|
- spec/features/support/shared/connection_context.rb
|
297
298
|
- spec/features/support/email_server.rb
|
298
299
|
- spec/features/restore_spec.rb
|
300
|
+
- spec/features/status_spec.rb
|
299
301
|
- spec/features/backup_spec.rb
|
300
302
|
- spec/support/higline_test_helpers.rb
|
301
303
|
- spec/support/fixtures.rb
|