-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! Test CloudflareProtectedEmailAddress
- Loading branch information
Oliver Denman
committed
May 25, 2017
1 parent
81bbedf
commit ae51cff
Showing
1 changed file
with
14 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,21 @@ | |
require_relative '../lib/cloudflare_protected_email_address' | ||
|
||
describe CloudflareProtectedEmailAddress do | ||
let(:email) do | ||
CloudflareProtectedEmailAddress.new(obfuscated: 'b3d2dfd7dcc5d6c1d2f3d7dac3c6c7d2d7dcc09dd4dcc59dc3ca') | ||
.human_readable | ||
it 'will make an obfuscated email address human readable' do | ||
CloudflareProtectedEmailAddress.new('b3d2dfd7dcc5d6c1d2f3d7dac3c6c7d2d7dcc09dd4dcc59dc3ca') | ||
.unobfuscated | ||
.must_equal '[email protected]' | ||
end | ||
|
||
it 'will make an obfuscated email address human readable' do | ||
email.must_equal '[email protected]' | ||
it 'returns the initialization email when it is not obfuscated' do | ||
CloudflareProtectedEmailAddress.new('[email protected]') | ||
.unobfuscated | ||
.must_equal '[email protected]' | ||
end | ||
|
||
it 'returns the original string when the initialization string is not an obfuscated email' do | ||
CloudflareProtectedEmailAddress.new('xyz789') | ||
.unobfuscated | ||
.must_equal 'xyz789' | ||
end | ||
end |