gmail 0.4.2 → 0.5.0
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/.gitignore +1 -0
- data/.rubocop.yml +13 -0
- data/.rubocop_todo.yml +239 -0
- data/.travis.yml +19 -0
- data/CHANGELOG.md +75 -18
- data/Gemfile +1 -1
- data/README.md +214 -131
- data/Rakefile +11 -0
- data/gmail.gemspec +8 -8
- data/lib/gmail.rb +31 -18
- data/lib/gmail/client.rb +11 -7
- data/lib/gmail/client/base.rb +52 -48
- data/lib/gmail/client/plain.rb +9 -5
- data/lib/gmail/client/xoauth.rb +23 -6
- data/lib/gmail/client/xoauth2.rb +39 -0
- data/lib/gmail/imap_extensions.rb +150 -0
- data/lib/gmail/labels.rb +33 -16
- data/lib/gmail/mailbox.rb +60 -42
- data/lib/gmail/message.rb +142 -101
- data/lib/gmail/version.rb +2 -2
- data/spec/account.yml.obfus +2 -0
- data/spec/gmail/client/base_spec.rb +5 -0
- data/spec/gmail/client/plain_spec.rb +168 -0
- data/spec/gmail/client/xoauth2_spec.rb +186 -0
- data/spec/gmail/client/xoauth_spec.rb +5 -0
- data/spec/gmail/client_spec.rb +5 -0
- data/spec/gmail/imap_extensions_spec.rb +12 -0
- data/spec/gmail/labels_spec.rb +18 -0
- data/spec/{mailbox_spec.rb → gmail/mailbox_spec.rb} +14 -14
- data/spec/gmail/message_spec.rb +181 -0
- data/spec/gmail_spec.rb +21 -21
- data/spec/recordings/gmail/_new_connects_with_client_and_give_it_context_when_block_given.yml +28 -0
- data/spec/recordings/gmail/_new_connects_with_gmail_service_and_return_valid_connection_object.yml +28 -0
- data/spec/recordings/gmail/_new_does_not_raise_error_when_couldn_t_connect_with_given_account.yml +13 -0
- data/spec/recordings/gmail/_new_raises_error_when_couldn_t_connect_with_given_account.yml +13 -0
- data/spec/recordings/gmail_client_plain/instance/_connection_automatically_logs_in_to_gmail_account_when_it_s_called.yml +42 -0
- data/spec/recordings/gmail_client_plain/instance/delivers_inline_composed_email.yml +42 -0
- data/spec/recordings/gmail_client_plain/instance/does_not_log_in_when_given_gmail_account_is_invalid.yml +13 -0
- data/spec/recordings/gmail_client_plain/instance/does_not_raise_error_even_though_gmail_account_is_invalid.yml +13 -0
- data/spec/recordings/gmail_client_plain/instance/labels/checks_if_there_is_given_label_defined.yml +196 -0
- data/spec/recordings/gmail_client_plain/instance/labels/creates_given_label.yml +151 -0
- data/spec/recordings/gmail_client_plain/instance/labels/removes_existing_label.yml +146 -0
- data/spec/recordings/gmail_client_plain/instance/labels/returns_list_of_all_available_labels.yml +113 -0
- data/spec/recordings/gmail_client_plain/instance/properly_logs_in_to_valid_gmail_account.yml +42 -0
- data/spec/recordings/gmail_client_plain/instance/properly_logs_out_from_gmail.yml +42 -0
- data/spec/recordings/gmail_client_plain/instance/properly_switches_to_given_mailbox.yml +109 -0
- data/spec/recordings/gmail_client_plain/instance/properly_switches_to_given_mailbox_using_block_style.yml +109 -0
- data/spec/recordings/gmail_client_plain/instance/raises_error_when_given_gmail_account_is_invalid_and_errors_enabled.yml +13 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/does_not_log_in_when_given_gmail_account_is_invalid.yml +13 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/labels/checks_if_there_is_given_label_defined.yml +27 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/labels/creates_given_label.yml +39 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/labels/removes_existing_label.yml +39 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/labels/returns_list_of_all_available_labels.yml +27 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/properly_logs_in_to_valid_gmail_account.yml +15 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/properly_logs_out_from_gmail.yml +15 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/properly_switches_to_given_mailbox.yml +40 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/properly_switches_to_given_mailbox_using_block_style.yml +40 -0
- data/spec/recordings/gmail_client_xo_auth2/instance/raises_error_when_given_gmail_account_is_invalid_and_errors_enabled.yml +13 -0
- data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/all/localizes_into_the_appropriate_label.yml +116 -0
- data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/drafts/localizes_into_the_appropriate_label.yml +116 -0
- data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/flagged/localizes_into_the_appropriate_label.yml +116 -0
- data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/important/localizes_into_the_appropriate_label.yml +116 -0
- data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/inbox/localizes_into_the_appropriate_label.yml +42 -0
- data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/junk/localizes_into_the_appropriate_label.yml +116 -0
- data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/sent/localizes_into_the_appropriate_label.yml +116 -0
- data/spec/recordings/gmail_labels/localize/when_given_the_xl_is_tflag/trash/localizes_into_the_appropriate_label.yml +116 -0
- data/spec/recordings/gmail_mailbox/instance/counts_all_emails.yml +277 -0
- data/spec/recordings/gmail_mailbox/instance/finds_messages.yml +586 -0
- data/spec/recordings/gmail_mailbox/on_initialize/sets_client_and_name.yml +42 -0
- data/spec/recordings/gmail_mailbox/on_initialize/works_in_inbox_by_default.yml +42 -0
- data/spec/recordings/gmail_message/initialize/sets_prefetch_attrs.yml +578 -0
- data/spec/recordings/gmail_message/initialize/sets_uid_and_mailbox.yml +580 -0
- data/spec/recordings/gmail_message/instance_methods/deletes_itself.yml +637 -0
- data/spec/recordings/gmail_message/instance_methods/marks_itself_read.yml +682 -0
- data/spec/recordings/gmail_message/instance_methods/marks_itself_unread.yml +686 -0
- data/spec/recordings/gmail_message/instance_methods/moves_from_one_tag_to_other.yml +862 -0
- data/spec/recordings/gmail_message/instance_methods/removes_a_given_label.yml +776 -0
- data/spec/recordings/gmail_message/instance_methods/removes_a_given_label_with_old_method.yml +776 -0
- data/spec/recordings/gmail_message/instance_methods/sets_given_label.yml +690 -0
- data/spec/recordings/gmail_message/instance_methods/sets_given_label_with_old_method.yml +691 -0
- data/spec/spec_helper.rb +34 -10
- data/spec/support/imap_mock.rb +129 -0
- data/spec/support/obfuscation.rb +52 -0
- metadata +79 -30
- data/TODO.md +0 -12
- data/lib/gmail/client/imap_extensions.rb +0 -54
- data/spec/client_spec.rb +0 -178
- data/spec/message_spec.rb +0 -51
@@ -0,0 +1,181 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Gmail::Message do
|
4
|
+
describe "initialize" do
|
5
|
+
let(:client) { mock_client }
|
6
|
+
let(:mailbox) { client.mailbox(:all) }
|
7
|
+
|
8
|
+
subject do
|
9
|
+
mailbox.emails.first
|
10
|
+
end
|
11
|
+
|
12
|
+
it "sets uid and mailbox" do
|
13
|
+
expect(subject.instance_variable_get(:@mailbox)).to be_a Gmail::Mailbox
|
14
|
+
expect(subject.instance_variable_get(:@gmail)).to be_a Gmail::Client::Base
|
15
|
+
expect(subject.instance_variable_get(:@uid)).to be_a Integer
|
16
|
+
subject.labels
|
17
|
+
end
|
18
|
+
|
19
|
+
it "sets PREFETCH_ATTRS" do
|
20
|
+
expect(subject.uid).to be_a Integer
|
21
|
+
expect(subject.msg_id).to be_a Integer
|
22
|
+
expect(subject.thr_id).to be_a Integer
|
23
|
+
expect(subject.envelope).to be_a Net::IMAP::Envelope
|
24
|
+
expect(subject.message).to be_a Mail::Message
|
25
|
+
expect(subject.flags).to be_a Array
|
26
|
+
expect(subject.labels).to be_a Array
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "mocks" do
|
31
|
+
subject { Gmail::Message.new(double(:mailbox, :name => 'INBOX'), nil) }
|
32
|
+
before { allow_any_instance_of(Gmail::Message).to receive(:fetch).and_return('foo') }
|
33
|
+
|
34
|
+
describe "#mark" do
|
35
|
+
it "marks itself as read" do
|
36
|
+
expect(subject).to receive(:read!).with(no_args).once
|
37
|
+
subject.mark(:read)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "marks itself as unread" do
|
41
|
+
expect(subject).to receive(:unread!).with(no_args).once
|
42
|
+
subject.mark(:unread)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "marks itself as deleted" do
|
46
|
+
expect(subject).to receive(:delete!).with(no_args).once
|
47
|
+
subject.mark(:deleted)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "marks itself as spam" do
|
51
|
+
expect(subject).to receive(:spam!).with(no_args).once
|
52
|
+
subject.mark(:spam)
|
53
|
+
end
|
54
|
+
|
55
|
+
it "marks itself with a flag" do
|
56
|
+
expect(subject).to receive(:flag).with(:my_flag).once
|
57
|
+
subject.mark(:my_flag)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe "#read!" do
|
62
|
+
it "flags itself as :Seen" do
|
63
|
+
expect(subject).to receive(:flag).with(:Seen).once
|
64
|
+
subject.read!
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe "#unread!" do
|
69
|
+
it "unflags :Seen from itself" do
|
70
|
+
expect(subject).to receive(:unflag).with(:Seen).once
|
71
|
+
subject.unread!
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe "#star!" do
|
76
|
+
it "flags itself as '[Gmail]/Starred'" do
|
77
|
+
expect(subject).to receive(:flag).with(:Flagged).once
|
78
|
+
subject.star!
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe "#unstar!" do
|
83
|
+
it "unflags '[Gmail]/Starred' from itself" do
|
84
|
+
expect(subject).to receive(:unflag).with(:Flagged).once
|
85
|
+
subject.unstar!
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe "#spam!" do
|
90
|
+
it "moves itself to the spam folder" do
|
91
|
+
expect(subject).to receive(:add_label).with("\\Spam").once
|
92
|
+
subject.spam!
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
describe "#archive!" do
|
97
|
+
it "removes itself from the inbox" do
|
98
|
+
expect(subject).to receive(:remove_label).with("\\Inbox").once
|
99
|
+
subject.archive!
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
describe "instance methods" do
|
105
|
+
let(:client) { mock_client }
|
106
|
+
let(:message) { client.mailbox(:all).emails(:unread, :from => TEST_ACCOUNT[0].to_s, :subject => "Hello world!").last }
|
107
|
+
|
108
|
+
after { client.logout if client.logged_in? }
|
109
|
+
|
110
|
+
it "sets given label" do
|
111
|
+
message.add_label 'Awesome'
|
112
|
+
message.add_label 'Great'
|
113
|
+
|
114
|
+
expect(message.labels).to include("Awesome")
|
115
|
+
expect(message.labels).to include("Great")
|
116
|
+
expect(message.labels).to include("\\Inbox")
|
117
|
+
end
|
118
|
+
|
119
|
+
it "removes a given label" do
|
120
|
+
message.add_label 'Awesome'
|
121
|
+
message.add_label 'Great'
|
122
|
+
|
123
|
+
message.remove_label 'Awesome'
|
124
|
+
expect(message.labels).not_to include("Awesome")
|
125
|
+
expect(message.labels).to include("Great")
|
126
|
+
expect(message.labels).to include("\\Inbox")
|
127
|
+
expect(message.flags).not_to include(:Seen)
|
128
|
+
end
|
129
|
+
|
130
|
+
it "sets given label with old method" do
|
131
|
+
message.label! 'Awesome'
|
132
|
+
message.label! 'Great'
|
133
|
+
expect(message.labels).to include("Great")
|
134
|
+
expect(message.labels).to include("Awesome")
|
135
|
+
expect(message.labels).to include("\\Inbox")
|
136
|
+
end
|
137
|
+
|
138
|
+
it "removes a given label with old method" do
|
139
|
+
message.add_label 'Awesome'
|
140
|
+
message.add_label 'Great'
|
141
|
+
|
142
|
+
message.remove_label! 'Awesome'
|
143
|
+
expect(message.labels).not_to include("Awesome")
|
144
|
+
expect(message.labels).to include("Great")
|
145
|
+
expect(message.labels).to include("\\Inbox")
|
146
|
+
expect(message.flags).not_to include(:Seen)
|
147
|
+
end
|
148
|
+
|
149
|
+
it "moves from one tag to other" do
|
150
|
+
message.add_label 'Awesome'
|
151
|
+
message.remove_label 'Great'
|
152
|
+
|
153
|
+
message.move_to('Great', 'Awesome')
|
154
|
+
expect(message.labels).to include("Great")
|
155
|
+
expect(message.labels).not_to include("Awesome")
|
156
|
+
expect(message.labels).to include("\\Inbox")
|
157
|
+
end
|
158
|
+
|
159
|
+
it "marks itself read" do
|
160
|
+
message.mark(:unread)
|
161
|
+
|
162
|
+
message.mark(:read)
|
163
|
+
expect(message.flags).to include(:Seen)
|
164
|
+
end
|
165
|
+
|
166
|
+
it "marks itself unread" do
|
167
|
+
message.mark(:read)
|
168
|
+
|
169
|
+
message.mark(:unread)
|
170
|
+
expect(message.flags).not_to include(:Seen)
|
171
|
+
end
|
172
|
+
|
173
|
+
it "deletes itself" do
|
174
|
+
trash_count = client.mailbox(:trash).emails.count
|
175
|
+
|
176
|
+
message.delete!
|
177
|
+
|
178
|
+
expect(client.mailbox(:trash).emails.count).to eq(trash_count + 1)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
data/spec/gmail_spec.rb
CHANGED
@@ -1,39 +1,39 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe Gmail do
|
4
4
|
it "should be able to convert itself to IMAP date format" do
|
5
|
-
"20-12-1988".to_imap_date.
|
5
|
+
expect("20-12-1988".to_imap_date).to eq("20-December-1988")
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
%w[new new!].each do |method|
|
9
|
-
it "##{method}
|
9
|
+
it "##{method} connects with Gmail service and return valid connection object" do
|
10
10
|
gmail = Gmail.send(method, *TEST_ACCOUNT)
|
11
|
-
gmail.
|
12
|
-
gmail.connection.
|
13
|
-
gmail.
|
11
|
+
expect(gmail).to be_kind_of(Gmail::Client::Plain)
|
12
|
+
expect(gmail.connection).not_to be_nil
|
13
|
+
expect(gmail).to be_logged_in
|
14
14
|
end
|
15
|
-
|
16
|
-
it "##{method}
|
15
|
+
|
16
|
+
it "##{method} connects with client and give it context when block given" do
|
17
17
|
Gmail.send(method, *TEST_ACCOUNT) do |gmail|
|
18
|
-
gmail.
|
19
|
-
gmail.connection.
|
20
|
-
gmail.
|
18
|
+
expect(gmail).to be_kind_of(Gmail::Client::Plain)
|
19
|
+
expect(gmail.connection).not_to be_nil
|
20
|
+
expect(gmail).to be_logged_in
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
25
|
-
it "#new
|
26
|
-
|
24
|
+
|
25
|
+
it "#new does not raise error when couldn't connect with given account" do
|
26
|
+
expect {
|
27
27
|
gmail = Gmail.new("foo", "bar")
|
28
|
-
gmail.
|
29
|
-
}.
|
28
|
+
expect(gmail).not_to be_logged_in
|
29
|
+
}.not_to raise_error
|
30
30
|
end
|
31
31
|
|
32
|
-
it "#new!
|
33
|
-
|
32
|
+
it "#new! raises error when couldn't connect with given account" do
|
33
|
+
expect {
|
34
34
|
gmail = Gmail.new!("foo", "bar")
|
35
|
-
gmail.
|
36
|
-
}.
|
35
|
+
expect(gmail).not_to be_logged_in
|
36
|
+
}.to raise_error
|
37
37
|
### FIX: can someone dig to the bottom of this? We are getting NoMethodError instead of Gmail::Client::AuthorizationError in 1.9
|
38
38
|
end
|
39
39
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
LOGIN-9a890af1c86854f5170d99be6e10b8f1:
|
3
|
+
- - :return
|
4
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
5
|
+
tag: RUBY0001
|
6
|
+
name: OK
|
7
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
8
|
+
code:
|
9
|
+
text: ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated (Success)
|
10
|
+
raw_data: "RUBY0001 OK ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated
|
11
|
+
(Success)\r\n"
|
12
|
+
- CAPABILITY:
|
13
|
+
- - IMAP4REV1
|
14
|
+
- UNSELECT
|
15
|
+
- IDLE
|
16
|
+
- NAMESPACE
|
17
|
+
- QUOTA
|
18
|
+
- ID
|
19
|
+
- XLIST
|
20
|
+
- CHILDREN
|
21
|
+
- X-GM-EXT-1
|
22
|
+
- UIDPLUS
|
23
|
+
- COMPRESS=DEFLATE
|
24
|
+
- ENABLE
|
25
|
+
- MOVE
|
26
|
+
- CONDSTORE
|
27
|
+
- ESEARCH
|
28
|
+
- UTF8=ACCEPT
|
data/spec/recordings/gmail/_new_connects_with_gmail_service_and_return_valid_connection_object.yml
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
LOGIN-9a890af1c86854f5170d99be6e10b8f1:
|
3
|
+
- - :return
|
4
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
5
|
+
tag: RUBY0001
|
6
|
+
name: OK
|
7
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
8
|
+
code:
|
9
|
+
text: ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated (Success)
|
10
|
+
raw_data: "RUBY0001 OK ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated
|
11
|
+
(Success)\r\n"
|
12
|
+
- CAPABILITY:
|
13
|
+
- - IMAP4REV1
|
14
|
+
- UNSELECT
|
15
|
+
- IDLE
|
16
|
+
- NAMESPACE
|
17
|
+
- QUOTA
|
18
|
+
- ID
|
19
|
+
- XLIST
|
20
|
+
- CHILDREN
|
21
|
+
- X-GM-EXT-1
|
22
|
+
- UIDPLUS
|
23
|
+
- COMPRESS=DEFLATE
|
24
|
+
- ENABLE
|
25
|
+
- MOVE
|
26
|
+
- CONDSTORE
|
27
|
+
- ESEARCH
|
28
|
+
- UTF8=ACCEPT
|
data/spec/recordings/gmail/_new_does_not_raise_error_when_couldn_t_connect_with_given_account.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
LOGIN-f0cde728d1c78eb72490f79825821b1c:
|
3
|
+
- - :raise
|
4
|
+
- !ruby/exception:Net::IMAP::NoResponseError
|
5
|
+
message: Invalid credentials e5mb14145422oah
|
6
|
+
response: !ruby/struct:Net::IMAP::TaggedResponse
|
7
|
+
tag: RUBY0001
|
8
|
+
name: 'NO'
|
9
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
10
|
+
code:
|
11
|
+
text: Invalid credentials e5mb14145422oah
|
12
|
+
raw_data: "RUBY0001 NO Invalid credentials e5mb14145422oah\r\n"
|
13
|
+
- {}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
LOGIN-f0cde728d1c78eb72490f79825821b1c:
|
3
|
+
- - :raise
|
4
|
+
- !ruby/exception:Net::IMAP::NoResponseError
|
5
|
+
message: Invalid credentials ld5mb12086173obb
|
6
|
+
response: !ruby/struct:Net::IMAP::TaggedResponse
|
7
|
+
tag: RUBY0001
|
8
|
+
name: 'NO'
|
9
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
10
|
+
code:
|
11
|
+
text: Invalid credentials ld5mb12086173obb
|
12
|
+
raw_data: "RUBY0001 NO Invalid credentials ld5mb12086173obb\r\n"
|
13
|
+
- {}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
LOGIN-9a890af1c86854f5170d99be6e10b8f1:
|
3
|
+
- - :return
|
4
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
5
|
+
tag: RUBY0001
|
6
|
+
name: OK
|
7
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
8
|
+
code:
|
9
|
+
text: ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated (Success)
|
10
|
+
raw_data: "RUBY0001 OK ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated
|
11
|
+
(Success)\r\n"
|
12
|
+
- CAPABILITY: &1
|
13
|
+
- - IMAP4REV1
|
14
|
+
- UNSELECT
|
15
|
+
- IDLE
|
16
|
+
- NAMESPACE
|
17
|
+
- QUOTA
|
18
|
+
- ID
|
19
|
+
- XLIST
|
20
|
+
- CHILDREN
|
21
|
+
- X-GM-EXT-1
|
22
|
+
- UIDPLUS
|
23
|
+
- COMPRESS=DEFLATE
|
24
|
+
- ENABLE
|
25
|
+
- MOVE
|
26
|
+
- CONDSTORE
|
27
|
+
- ESEARCH
|
28
|
+
- UTF8=ACCEPT
|
29
|
+
LOGOUT-e76a09b7766d60a37ff9e1af527a143e:
|
30
|
+
- - :return
|
31
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
32
|
+
tag: RUBY0002
|
33
|
+
name: OK
|
34
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
35
|
+
code:
|
36
|
+
text: 73 good day (Success)
|
37
|
+
raw_data: "RUBY0002 OK 73 good day (Success)\r\n"
|
38
|
+
- CAPABILITY: *1
|
39
|
+
BYE:
|
40
|
+
- !ruby/struct:Net::IMAP::ResponseText
|
41
|
+
code:
|
42
|
+
text: LOGOUT Requested
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
LOGIN-9a890af1c86854f5170d99be6e10b8f1:
|
3
|
+
- - :return
|
4
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
5
|
+
tag: RUBY0001
|
6
|
+
name: OK
|
7
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
8
|
+
code:
|
9
|
+
text: ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated (Success)
|
10
|
+
raw_data: "RUBY0001 OK ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated
|
11
|
+
(Success)\r\n"
|
12
|
+
- CAPABILITY: &1
|
13
|
+
- - IMAP4REV1
|
14
|
+
- UNSELECT
|
15
|
+
- IDLE
|
16
|
+
- NAMESPACE
|
17
|
+
- QUOTA
|
18
|
+
- ID
|
19
|
+
- XLIST
|
20
|
+
- CHILDREN
|
21
|
+
- X-GM-EXT-1
|
22
|
+
- UIDPLUS
|
23
|
+
- COMPRESS=DEFLATE
|
24
|
+
- ENABLE
|
25
|
+
- MOVE
|
26
|
+
- CONDSTORE
|
27
|
+
- ESEARCH
|
28
|
+
- UTF8=ACCEPT
|
29
|
+
LOGOUT-e76a09b7766d60a37ff9e1af527a143e:
|
30
|
+
- - :return
|
31
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
32
|
+
tag: RUBY0002
|
33
|
+
name: OK
|
34
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
35
|
+
code:
|
36
|
+
text: 73 good day (Success)
|
37
|
+
raw_data: "RUBY0002 OK 73 good day (Success)\r\n"
|
38
|
+
- CAPABILITY: *1
|
39
|
+
BYE:
|
40
|
+
- !ruby/struct:Net::IMAP::ResponseText
|
41
|
+
code:
|
42
|
+
text: LOGOUT Requested
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
LOGIN-f0cde728d1c78eb72490f79825821b1c:
|
3
|
+
- - :raise
|
4
|
+
- !ruby/exception:Net::IMAP::NoResponseError
|
5
|
+
message: Invalid credentials vz12mb11973448obc
|
6
|
+
response: !ruby/struct:Net::IMAP::TaggedResponse
|
7
|
+
tag: RUBY0001
|
8
|
+
name: 'NO'
|
9
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
10
|
+
code:
|
11
|
+
text: Invalid credentials vz12mb11973448obc
|
12
|
+
raw_data: "RUBY0001 NO Invalid credentials vz12mb11973448obc\r\n"
|
13
|
+
- {}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
LOGIN-f0cde728d1c78eb72490f79825821b1c:
|
3
|
+
- - :raise
|
4
|
+
- !ruby/exception:Net::IMAP::NoResponseError
|
5
|
+
message: Invalid credentials xx2mb12249277obc
|
6
|
+
response: !ruby/struct:Net::IMAP::TaggedResponse
|
7
|
+
tag: RUBY0001
|
8
|
+
name: 'NO'
|
9
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
10
|
+
code:
|
11
|
+
text: Invalid credentials xx2mb12249277obc
|
12
|
+
raw_data: "RUBY0001 NO Invalid credentials xx2mb12249277obc\r\n"
|
13
|
+
- {}
|
data/spec/recordings/gmail_client_plain/instance/labels/checks_if_there_is_given_label_defined.yml
ADDED
@@ -0,0 +1,196 @@
|
|
1
|
+
---
|
2
|
+
LOGIN-9a890af1c86854f5170d99be6e10b8f1:
|
3
|
+
- - :return
|
4
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
5
|
+
tag: RUBY0001
|
6
|
+
name: OK
|
7
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
8
|
+
code:
|
9
|
+
text: ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated (Success)
|
10
|
+
raw_data: "RUBY0001 OK ki0zvkyi1yzgy7xu4f4dh46nqrcecm@gmail.com authenticated
|
11
|
+
(Success)\r\n"
|
12
|
+
- CAPABILITY: &1
|
13
|
+
- - IMAP4REV1
|
14
|
+
- UNSELECT
|
15
|
+
- IDLE
|
16
|
+
- NAMESPACE
|
17
|
+
- QUOTA
|
18
|
+
- ID
|
19
|
+
- XLIST
|
20
|
+
- CHILDREN
|
21
|
+
- X-GM-EXT-1
|
22
|
+
- UIDPLUS
|
23
|
+
- COMPRESS=DEFLATE
|
24
|
+
- ENABLE
|
25
|
+
- MOVE
|
26
|
+
- CONDSTORE
|
27
|
+
- ESEARCH
|
28
|
+
- UTF8=ACCEPT
|
29
|
+
LIST-e0583fa6130ee374cef031c01d8cc486:
|
30
|
+
- - :return
|
31
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
32
|
+
tag: RUBY0002
|
33
|
+
name: OK
|
34
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
35
|
+
code:
|
36
|
+
text: Success
|
37
|
+
raw_data: "RUBY0002 OK Success\r\n"
|
38
|
+
- CAPABILITY: *1
|
39
|
+
LIST:
|
40
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
41
|
+
attr:
|
42
|
+
- :Hasnochildren
|
43
|
+
delim: "/"
|
44
|
+
name: Awesome
|
45
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
46
|
+
attr:
|
47
|
+
- :Hasnochildren
|
48
|
+
delim: "/"
|
49
|
+
name: Great
|
50
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
51
|
+
attr:
|
52
|
+
- :Hasnochildren
|
53
|
+
delim: "/"
|
54
|
+
name: INBOX
|
55
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
56
|
+
attr:
|
57
|
+
- :Noselect
|
58
|
+
- :Haschildren
|
59
|
+
delim: "/"
|
60
|
+
name: "[Gmail]"
|
61
|
+
- - :return
|
62
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
63
|
+
tag: RUBY0004
|
64
|
+
name: OK
|
65
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
66
|
+
code:
|
67
|
+
text: Success
|
68
|
+
raw_data: "RUBY0004 OK Success\r\n"
|
69
|
+
- CAPABILITY: *1
|
70
|
+
LIST:
|
71
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
72
|
+
attr:
|
73
|
+
- :Hasnochildren
|
74
|
+
delim: "/"
|
75
|
+
name: Awesome
|
76
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
77
|
+
attr:
|
78
|
+
- :Hasnochildren
|
79
|
+
delim: "/"
|
80
|
+
name: Great
|
81
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
82
|
+
attr:
|
83
|
+
- :Hasnochildren
|
84
|
+
delim: "/"
|
85
|
+
name: INBOX
|
86
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
87
|
+
attr:
|
88
|
+
- :Noselect
|
89
|
+
- :Haschildren
|
90
|
+
delim: "/"
|
91
|
+
name: "[Gmail]"
|
92
|
+
LIST-94cc1ce946087e61b81baed886d31dbc:
|
93
|
+
- - :return
|
94
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
95
|
+
tag: RUBY0003
|
96
|
+
name: OK
|
97
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
98
|
+
code:
|
99
|
+
text: Success
|
100
|
+
raw_data: "RUBY0003 OK Success\r\n"
|
101
|
+
- CAPABILITY: *1
|
102
|
+
LIST:
|
103
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
104
|
+
attr:
|
105
|
+
- :Hasnochildren
|
106
|
+
- :All
|
107
|
+
delim: "/"
|
108
|
+
name: "[Gmail]/All Mail"
|
109
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
110
|
+
attr:
|
111
|
+
- :Hasnochildren
|
112
|
+
- :Drafts
|
113
|
+
delim: "/"
|
114
|
+
name: "[Gmail]/Drafts"
|
115
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
116
|
+
attr:
|
117
|
+
- :Hasnochildren
|
118
|
+
- :Important
|
119
|
+
delim: "/"
|
120
|
+
name: "[Gmail]/Important"
|
121
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
122
|
+
attr:
|
123
|
+
- :Sent
|
124
|
+
- :Hasnochildren
|
125
|
+
delim: "/"
|
126
|
+
name: "[Gmail]/Sent Mail"
|
127
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
128
|
+
attr:
|
129
|
+
- :Hasnochildren
|
130
|
+
- :Junk
|
131
|
+
delim: "/"
|
132
|
+
name: "[Gmail]/Spam"
|
133
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
134
|
+
attr:
|
135
|
+
- :Hasnochildren
|
136
|
+
- :Flagged
|
137
|
+
delim: "/"
|
138
|
+
name: "[Gmail]/Starred"
|
139
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
140
|
+
attr:
|
141
|
+
- :Trash
|
142
|
+
- :Hasnochildren
|
143
|
+
delim: "/"
|
144
|
+
name: "[Gmail]/Trash"
|
145
|
+
- - :return
|
146
|
+
- !ruby/struct:Net::IMAP::TaggedResponse
|
147
|
+
tag: RUBY0005
|
148
|
+
name: OK
|
149
|
+
data: !ruby/struct:Net::IMAP::ResponseText
|
150
|
+
code:
|
151
|
+
text: Success
|
152
|
+
raw_data: "RUBY0005 OK Success\r\n"
|
153
|
+
- CAPABILITY: *1
|
154
|
+
LIST:
|
155
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
156
|
+
attr:
|
157
|
+
- :Hasnochildren
|
158
|
+
- :All
|
159
|
+
delim: "/"
|
160
|
+
name: "[Gmail]/All Mail"
|
161
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
162
|
+
attr:
|
163
|
+
- :Hasnochildren
|
164
|
+
- :Drafts
|
165
|
+
delim: "/"
|
166
|
+
name: "[Gmail]/Drafts"
|
167
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
168
|
+
attr:
|
169
|
+
- :Hasnochildren
|
170
|
+
- :Important
|
171
|
+
delim: "/"
|
172
|
+
name: "[Gmail]/Important"
|
173
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
174
|
+
attr:
|
175
|
+
- :Sent
|
176
|
+
- :Hasnochildren
|
177
|
+
delim: "/"
|
178
|
+
name: "[Gmail]/Sent Mail"
|
179
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
180
|
+
attr:
|
181
|
+
- :Hasnochildren
|
182
|
+
- :Junk
|
183
|
+
delim: "/"
|
184
|
+
name: "[Gmail]/Spam"
|
185
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
186
|
+
attr:
|
187
|
+
- :Hasnochildren
|
188
|
+
- :Flagged
|
189
|
+
delim: "/"
|
190
|
+
name: "[Gmail]/Starred"
|
191
|
+
- !ruby/struct:Net::IMAP::MailboxList
|
192
|
+
attr:
|
193
|
+
- :Trash
|
194
|
+
- :Hasnochildren
|
195
|
+
delim: "/"
|
196
|
+
name: "[Gmail]/Trash"
|