block_head 0.0.2 → 0.0.3

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
2
  SHA1:
3
- metadata.gz: e1e38fcca27dada17d3423f2a0e62dde337695bf
4
- data.tar.gz: 628586da4b3987d87bc6f3946eadabdcee1748e0
3
+ metadata.gz: 45f0a511282d58cced9c6c8f7351b5abd1a81556
4
+ data.tar.gz: d27365e1e752e3c92f02a93f11ac01db71c79ca8
5
5
  SHA512:
6
- metadata.gz: ee6af40430cdeeaef9fd1c7626a1c19a6da03847911e7d1805ead20f552dc4c30e65466ed4d08cd409f7b2bff47587b2b35108eacf21d747c3d2b690b1cafc9a
7
- data.tar.gz: 64ff68e99b9d72b3fc9c905a23c1bceca6aa0538db1fdddbc1b7f6ed5e0f440480ad8a077c0527061acf33f2ddeddd2db34d6a1c4ab2e1f6902749c2ddee418a
6
+ metadata.gz: 8ea1f82114e3b7a5bf27e9c3874989b78cf7b41b66e9d96501be9d3b4deeffaa3d4d5dcf5ce2bcd2ba01eb6625907bb6ebcbec19c5f2c748c8eac4617b87418c
7
+ data.tar.gz: 125c92d324cddcbc6234d9b5144a4e6080adb9ab6bf3a00663339dd5dbc0fad6f066ad1ded3ba73c0e05db55db2036c4d6170aa8b9ffeecc99ff04243971b6e8
@@ -13,7 +13,7 @@ class DomainInterceptor
13
13
  private
14
14
 
15
15
  def destination_has_valid_domain?(message)
16
- message.to.any? do |recipient|
16
+ message.to.all? do |recipient|
17
17
  recipient_domain = recipient.split("@")[1]
18
18
  domains.include?(recipient_domain)
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module BlockHead
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -11,12 +11,13 @@ describe DomainInterceptor do
11
11
  let(:message) { double(:message) }
12
12
 
13
13
  before do
14
- allow(message).to receive(:to) { [destination_address] }
14
+ allow(message).to receive(:to) { [destination_address_1, destination_address_2] }
15
15
  allow(message).to receive(:to=)
16
16
  end
17
17
 
18
- context "when the given email matches any of the domains given" do
19
- let(:destination_address) { "noah@hotmail.com" }
18
+ context "when the given email matches all of the domains given" do
19
+ let(:destination_address_1) { "noah@hotmail.com" }
20
+ let(:destination_address_2) { "joe@hotmail.com" }
20
21
 
21
22
  it "does not manipulate the destination of the given email" do
22
23
  interceptor.delivering_email(message)
@@ -24,8 +25,9 @@ describe DomainInterceptor do
24
25
  end
25
26
  end
26
27
 
27
- context "when the given email does not match any of the domains given" do
28
- let(:destination_address) { "noah@gmail.com" }
28
+ context "when the given email does not match one of the domains given" do
29
+ let(:destination_address_1) { "noah@gmail.com" }
30
+ let(:destination_address_2) { "noah@hotmail.com" }
29
31
 
30
32
  it "changes the destination of the given email to the default recipient" do
31
33
  interceptor.delivering_email(message)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: block_head
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Letizia