Skip to content

Commit

Permalink
fixup! Test CloudflareProtectedEmailAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Denman committed May 25, 2017
1 parent 81bbedf commit ae51cff
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions test/cloudflare_protected_email_address_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ae51cff

Please sign in to comment.