-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
Values::Website#===
to match against Values::EmailAddress
.
- Loading branch information
1 parent
d89411a
commit bb2e21d
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,6 +242,38 @@ | |
end | ||
end | ||
|
||
context "when given a EmailAddress object" do | ||
context "and the other EmailAddress value ends with the same domain as the website" do | ||
let(:other) do | ||
Ronin::Recon::Values::EmailAddress.new("john.smith@#{host}") | ||
end | ||
|
||
it "must return true" do | ||
expect(subject === other).to be(true) | ||
end | ||
end | ||
|
||
context "but the other EmailAddress value ends with a sub-domain of the website's host name" do | ||
let(:other) do | ||
Ronin::Recon::Values::EmailAddress.new("john.smith@subdomain.#{host}") | ||
end | ||
|
||
it "must return false" do | ||
expect(subject === other).to be(false) | ||
end | ||
end | ||
|
||
context "but the other EmailAddress value ends with a different domain than the website" do | ||
let(:other) do | ||
Ronin::Recon::Values::EmailAddress.new("[email protected]") | ||
end | ||
|
||
it "must return false" do | ||
expect(subject === other).to be(false) | ||
end | ||
end | ||
end | ||
|
||
context "when given a non-Value object" do | ||
let(:other) { Object.new } | ||
|
||
|