email_spec 2.2.0 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 6953e2bb1e960ed248a93cd7cbf47dbc0dedbfa3
4
- data.tar.gz: 48595daa6d8a485acae168fd690261db13e39216
2
+ SHA256:
3
+ metadata.gz: 67b5cef2ce1c7cb7d919d61567a3fcdedab6747bf016962ca03da9b1d2abf660
4
+ data.tar.gz: 3694cba82a8b25469d5c0a7e5ec9f7d688471d357926a46cb37e7290320222f8
5
5
  SHA512:
6
- metadata.gz: edf125d376b91ba678cb815c18413618d8062bd89b39a039629ce304c1f5ec057cd07f9ad37e38f6ef4f2debbba226310075f0b72ff72e795d9e757dc5a052f8
7
- data.tar.gz: 82794056b0200b35691a1e359a5c5b23c58abb09fa25c3798b1f3b18ee3145256115ffc615cedd5aedabedd66ab80bb81adbdf3c840901a92c4b0a2d8ad9ef81
6
+ metadata.gz: 780394b891b7fbcc9a75629fd20608e99730cca2a1ecf5882193d7e8f2fc59fd115c4360d517c1a0f94d7b6e8ca56c0bf01e00ae91f8f42f592d0d169fed09ae
7
+ data.tar.gz: 790bb0a29b5c44aacb5ddfb5c9d9f049cedea133df51a2ccf66c41f364b4610450ebb01ce4aa92a2f18ef815e4c48d402863fcb5a41530e7d819f3475242f01c
data/Changelog.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 2.2.2 2023-06-26
2
+
3
+ * [Defer accommodating different delivery methods to runtime](https://github.com/email-spec/email-spec/pull/224)
4
+
5
+ ## 2.2.1 2022-09-12
6
+
7
+ * [Support to decode part in EmailSpec::MailExt#default_part_body](https://github.com/email-spec/email-spec/pull/211)
8
+ * [Drop rubyforge_project from gemspec](https://github.com/email-spec/email-spec/pull/215)
9
+ * [Avoid eagerly loading ActionMailer::Base](https://github.com/email-spec/email-spec/pull/219)
10
+ * [README: use SVG badges](https://github.com/email-spec/email-spec/pull/217)
11
+
1
12
  ## 2.2.0 2018-04-03
2
13
 
3
14
  * Support for `spinach` (@pedantic-git)
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
-
2
- [![Build Status](https://secure.travis-ci.org/email-spec/email-spec.png)](http://travis-ci.org/email-spec/email-spec)
1
+ [![Build Status](https://secure.travis-ci.org/email-spec/email-spec.svg)](http://travis-ci.org/email-spec/email-spec)
3
2
 
4
3
  ## Email Spec
5
4
 
@@ -339,6 +338,10 @@ email = UserMailer.create_signup "jojo@yahoo.com", "Jojo Binks"
339
338
  assert_must deliver_to("jojo@yahoo.com"), email
340
339
  ```
341
340
 
341
+ ## Issue triage [![Open Source Helpers](https://www.codetriage.com/email-spec/email-spec/badges/users.svg)](https://www.codetriage.com/email-spec/email-spec)
342
+
343
+ You can contribute by triaging issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to email-spec on CodeTriage](https://www.codetriage.com/email-spec/email-spec).
344
+
342
345
  ## Original Authors
343
346
 
344
347
  Ben Mabey, Aaron Gibralter, Mischa Fierer
@@ -1,5 +1,5 @@
1
1
  module EmailSpec
2
- module MailerDeliveries
2
+ module Deliveries
3
3
  def all_emails
4
4
  deliveries
5
5
  end
@@ -9,7 +9,9 @@ module EmailSpec
9
9
  end
10
10
 
11
11
  def reset_mailer
12
- if defined?(ActionMailer) && ActionMailer::Base.delivery_method == :cache
12
+ if defined?(ActionMailer) && ActionMailer::Base.delivery_method == :activerecord
13
+ Email.delete_all
14
+ elsif defined?(ActionMailer) && ActionMailer::Base.delivery_method == :cache
13
15
  mailer.clear_cache
14
16
  else
15
17
  deliveries.clear
@@ -23,36 +25,22 @@ module EmailSpec
23
25
  protected
24
26
 
25
27
  def deliveries
26
- if ActionMailer::Base.delivery_method == :cache
28
+ if defined?(Pony)
29
+ Pony.deliveries
30
+ elsif ActionMailer::Base.delivery_method == :activerecord
31
+ Email.all.map { |email| parse_ar_to_mail(email) }
32
+ elsif ActionMailer::Base.delivery_method == :cache
27
33
  mailer.cached_deliveries
28
34
  else
29
35
  mailer.deliveries
30
36
  end
31
37
  end
32
- end
33
-
34
- module ARMailerDeliveries
35
- def all_emails
36
- Email.all.map{ |email| parse_to_mail(email) }
37
- end
38
38
 
39
- def last_email_sent
40
- if email = Email.last
41
- parse_to_mail(email)
42
- else
43
- raise("No email has been sent!")
44
- end
39
+ def mailer
40
+ ActionMailer::Base
45
41
  end
46
42
 
47
- def reset_mailer
48
- Email.delete_all
49
- end
50
-
51
- def mailbox_for(address)
52
- Email.all.select { |email| email.destinations.include?(address) }.map{ |email| parse_to_mail(email) }
53
- end
54
-
55
- def parse_to_mail(email)
43
+ def parse_ar_to_mail(email)
56
44
  Mail.read(email.mail)
57
45
  end
58
46
  end
@@ -68,17 +56,4 @@ module EmailSpec
68
56
  end
69
57
  end
70
58
  end
71
-
72
- module Deliveries
73
- if defined?(Pony)
74
- def deliveries; Pony::deliveries ; end
75
- include EmailSpec::MailerDeliveries
76
- elsif ActionMailer::Base.delivery_method == :activerecord
77
- include EmailSpec::ARMailerDeliveries
78
- else
79
- def mailer; ActionMailer::Base; end
80
- include EmailSpec::MailerDeliveries
81
- end
82
- end
83
59
  end
84
-
@@ -5,11 +5,11 @@ module EmailSpec::MailExt
5
5
 
6
6
  def default_part_body
7
7
  # Calling to_str as we want the actual String object
8
- HTMLEntities.new.decode(default_part.body.to_s.to_str)
8
+ HTMLEntities.new.decode(default_part.decoded.to_s.to_str)
9
9
  end
10
10
 
11
11
  def html
12
- html_part ? html_part.body.raw_source : nil
12
+ html_part ? html_part.decoded : nil
13
13
  end
14
14
  end
15
15
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EmailSpec
2
- VERSION = '2.2.0'
4
+ VERSION = "2.2.2"
3
5
  end
@@ -35,6 +35,13 @@ describe EmailSpec::MailExt do
35
35
  email = Mail.new(:body => ActiveSupport::SafeBuffer.new("bacon & pancake"))
36
36
  expect(email.default_part_body).to eq ("bacon & pancake")
37
37
  end
38
+
39
+ it "decodes parts before return" do
40
+ email = Mail.new(:body => "hello\r\nquoted-printable")
41
+ email.content_transfer_encoding = 'quoted-printable'
42
+ expect(email.encoded).to include("hello=0D\nquoted-printable")
43
+ expect(email.default_part_body).to eq("hello\r\nquoted-printable")
44
+ end
38
45
  end
39
46
 
40
47
  describe "#html" do
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Mabey
8
8
  - Aaron Gibralter
9
9
  - Mischa Fierer
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-04-03 00:00:00.000000000 Z
13
+ date: 2023-06-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: htmlentities
@@ -179,7 +179,6 @@ files:
179
179
  - README.md
180
180
  - Rakefile
181
181
  - examples/rails4_root/Gemfile
182
- - examples/rails4_root/Gemfile.lock
183
182
  - examples/rails4_root/README
184
183
  - examples/rails4_root/Rakefile
185
184
  - examples/rails4_root/app/controllers/application_controller.rb
@@ -223,7 +222,6 @@ files:
223
222
  - examples/rails4_root/db/migrate/20141119224309_add_queue_to_delayed_jobs.rb
224
223
  - examples/rails4_root/db/schema.rb
225
224
  - examples/rails4_root/db/seeds.rb
226
- - examples/rails4_root/db/test.sqlite3
227
225
  - examples/rails4_root/doc/README_FOR_APP
228
226
  - examples/rails4_root/features/attachments.feature
229
227
  - examples/rails4_root/features/delayed_job.feature
@@ -238,8 +236,6 @@ files:
238
236
  - examples/rails4_root/lib/notifier_job.rb
239
237
  - examples/rails4_root/lib/tasks/cucumber.rake
240
238
  - examples/rails4_root/lib/tasks/rspec.rake
241
- - examples/rails4_root/log/development.log
242
- - examples/rails4_root/log/test.log
243
239
  - examples/rails4_root/public/404.html
244
240
  - examples/rails4_root/public/422.html
245
241
  - examples/rails4_root/public/500.html
@@ -262,7 +258,6 @@ files:
262
258
  - examples/rails4_root/test/mailers/user_mailer_spec_test.rb
263
259
  - examples/rails4_root/test/test_helper.rb
264
260
  - examples/sinatra_root/Gemfile
265
- - examples/sinatra_root/Gemfile.lock
266
261
  - examples/sinatra_root/config.ru
267
262
  - examples/sinatra_root/features/errors.feature
268
263
  - examples/sinatra_root/features/example.feature
@@ -301,7 +296,7 @@ homepage: http://github.com/email-spec/email-spec/
301
296
  licenses:
302
297
  - MIT
303
298
  metadata: {}
304
- post_install_message:
299
+ post_install_message:
305
300
  rdoc_options: []
306
301
  require_paths:
307
302
  - lib
@@ -316,9 +311,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
311
  - !ruby/object:Gem::Version
317
312
  version: '0'
318
313
  requirements: []
319
- rubyforge_project: email-spec
320
- rubygems_version: 2.6.14
321
- signing_key:
314
+ rubygems_version: 3.4.10
315
+ signing_key:
322
316
  specification_version: 4
323
317
  summary: Easily test email in RSpec, Cucumber or Minitest
324
318
  test_files: []
@@ -1,199 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- email_spec (2.1.2)
5
- htmlentities (~> 4.3.3)
6
- launchy (~> 2.1)
7
- mail (~> 2.7)
8
-
9
- GEM
10
- remote: http://rubygems.org/
11
- specs:
12
- actionmailer (4.2.8)
13
- actionpack (= 4.2.8)
14
- actionview (= 4.2.8)
15
- activejob (= 4.2.8)
16
- mail (~> 2.5, >= 2.5.4)
17
- rails-dom-testing (~> 1.0, >= 1.0.5)
18
- actionpack (4.2.8)
19
- actionview (= 4.2.8)
20
- activesupport (= 4.2.8)
21
- rack (~> 1.6)
22
- rack-test (~> 0.6.2)
23
- rails-dom-testing (~> 1.0, >= 1.0.5)
24
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
25
- actionview (4.2.8)
26
- activesupport (= 4.2.8)
27
- builder (~> 3.1)
28
- erubis (~> 2.7.0)
29
- rails-dom-testing (~> 1.0, >= 1.0.5)
30
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
31
- activejob (4.2.8)
32
- activesupport (= 4.2.8)
33
- globalid (>= 0.3.0)
34
- activemodel (4.2.8)
35
- activesupport (= 4.2.8)
36
- builder (~> 3.1)
37
- activerecord (4.2.8)
38
- activemodel (= 4.2.8)
39
- activesupport (= 4.2.8)
40
- arel (~> 6.0)
41
- activesupport (4.2.8)
42
- i18n (~> 0.7)
43
- minitest (~> 5.1)
44
- thread_safe (~> 0.3, >= 0.3.4)
45
- tzinfo (~> 1.1)
46
- addressable (2.5.2)
47
- public_suffix (>= 2.0.2, < 4.0)
48
- arel (6.0.4)
49
- backports (3.11.1)
50
- builder (3.2.3)
51
- capybara (2.18.0)
52
- addressable
53
- mini_mime (>= 0.1.3)
54
- nokogiri (>= 1.3.3)
55
- rack (>= 1.0.0)
56
- rack-test (>= 0.5.4)
57
- xpath (>= 2.0, < 4.0)
58
- concurrent-ruby (1.0.5)
59
- crass (1.0.3)
60
- cucumber (3.1.0)
61
- builder (>= 2.1.2)
62
- cucumber-core (~> 3.1.0)
63
- cucumber-expressions (~> 5.0.4)
64
- cucumber-wire (~> 0.0.1)
65
- diff-lcs (~> 1.3)
66
- gherkin (~> 5.0)
67
- multi_json (>= 1.7.5, < 2.0)
68
- multi_test (>= 0.1.2)
69
- cucumber-core (3.1.0)
70
- backports (>= 3.8.0)
71
- cucumber-tag_expressions (~> 1.1.0)
72
- gherkin (>= 5.0.0)
73
- cucumber-expressions (5.0.13)
74
- cucumber-rails (1.5.0)
75
- capybara (>= 1.1.2, < 3)
76
- cucumber (>= 1.3.8, < 4)
77
- mime-types (>= 1.17, < 4)
78
- nokogiri (~> 1.5)
79
- railties (>= 4, < 5.2)
80
- cucumber-tag_expressions (1.1.1)
81
- cucumber-wire (0.0.1)
82
- database_cleaner (1.6.2)
83
- delayed_job (4.0.6)
84
- activesupport (>= 3.0, < 5.0)
85
- delayed_job_active_record (4.1.2)
86
- activerecord (>= 3.0, < 5.2)
87
- delayed_job (>= 3.0, < 5)
88
- diff-lcs (1.3)
89
- erubis (2.7.0)
90
- gherkin (5.0.0)
91
- globalid (0.4.1)
92
- activesupport (>= 4.2.0)
93
- htmlentities (4.3.4)
94
- i18n (0.9.5)
95
- concurrent-ruby (~> 1.0)
96
- launchy (2.4.3)
97
- addressable (~> 2.3)
98
- loofah (2.2.2)
99
- crass (~> 1.0.2)
100
- nokogiri (>= 1.5.9)
101
- mail (2.7.0)
102
- mini_mime (>= 0.1.1)
103
- mime-types (3.1)
104
- mime-types-data (~> 3.2015)
105
- mime-types-data (3.2016.0521)
106
- mimetype-fu (0.1.2)
107
- mini_mime (1.0.0)
108
- mini_portile2 (2.3.0)
109
- minitest (5.11.3)
110
- minitest-matchers (1.4.1)
111
- minitest (~> 5.0)
112
- minitest-rails (2.2.1)
113
- minitest (~> 5.7)
114
- railties (~> 4.1)
115
- multi_json (1.13.1)
116
- multi_test (0.1.2)
117
- nokogiri (1.8.2)
118
- mini_portile2 (~> 2.3.0)
119
- public_suffix (3.0.2)
120
- rack (1.6.9)
121
- rack-test (0.6.3)
122
- rack (>= 1.0)
123
- rails (4.2.8)
124
- actionmailer (= 4.2.8)
125
- actionpack (= 4.2.8)
126
- actionview (= 4.2.8)
127
- activejob (= 4.2.8)
128
- activemodel (= 4.2.8)
129
- activerecord (= 4.2.8)
130
- activesupport (= 4.2.8)
131
- bundler (>= 1.3.0, < 2.0)
132
- railties (= 4.2.8)
133
- sprockets-rails
134
- rails-deprecated_sanitizer (1.0.3)
135
- activesupport (>= 4.2.0.alpha)
136
- rails-dom-testing (1.0.9)
137
- activesupport (>= 4.2.0, < 5.0)
138
- nokogiri (~> 1.6)
139
- rails-deprecated_sanitizer (>= 1.0.1)
140
- rails-html-sanitizer (1.0.4)
141
- loofah (~> 2.2, >= 2.2.2)
142
- railties (4.2.8)
143
- actionpack (= 4.2.8)
144
- activesupport (= 4.2.8)
145
- rake (>= 0.8.7)
146
- thor (>= 0.18.1, < 2.0)
147
- rake (10.3.2)
148
- rspec-core (3.7.1)
149
- rspec-support (~> 3.7.0)
150
- rspec-expectations (3.7.0)
151
- diff-lcs (>= 1.2.0, < 2.0)
152
- rspec-support (~> 3.7.0)
153
- rspec-mocks (3.7.0)
154
- diff-lcs (>= 1.2.0, < 2.0)
155
- rspec-support (~> 3.7.0)
156
- rspec-rails (3.7.2)
157
- actionpack (>= 3.0)
158
- activesupport (>= 3.0)
159
- railties (>= 3.0)
160
- rspec-core (~> 3.7.0)
161
- rspec-expectations (~> 3.7.0)
162
- rspec-mocks (~> 3.7.0)
163
- rspec-support (~> 3.7.0)
164
- rspec-support (3.7.1)
165
- sprockets (3.7.1)
166
- concurrent-ruby (~> 1.0)
167
- rack (> 1, < 3)
168
- sprockets-rails (3.2.1)
169
- actionpack (>= 4.0)
170
- activesupport (>= 4.0)
171
- sprockets (>= 3.0.0)
172
- sqlite3 (1.3.13)
173
- thor (0.20.0)
174
- thread_safe (0.3.6)
175
- tzinfo (1.2.5)
176
- thread_safe (~> 0.1)
177
- xpath (3.0.0)
178
- nokogiri (~> 1.8)
179
-
180
- PLATFORMS
181
- ruby
182
-
183
- DEPENDENCIES
184
- capybara
185
- cucumber-rails
186
- database_cleaner
187
- delayed_job (~> 4.0.6)
188
- delayed_job_active_record
189
- email_spec!
190
- mimetype-fu
191
- minitest-matchers
192
- minitest-rails
193
- rails (= 4.2.8)
194
- rake (~> 10.3.2)
195
- rspec-rails
196
- sqlite3
197
-
198
- BUNDLED WITH
199
- 1.16.1
Binary file
File without changes