diff --git a/test/cloudflare_protected_email_address_test.rb b/test/cloudflare_protected_email_address_test.rb index 6f879a7..7051b83 100644 --- a/test/cloudflare_protected_email_address_test.rb +++ b/test/cloudflare_protected_email_address_test.rb @@ -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 'aldovera@diputados.gov.py' end - it 'will make an obfuscated email address human readable' do - email.must_equal 'aldovera@diputados.gov.py' + it 'returns the initialization email when it is not obfuscated' do + CloudflareProtectedEmailAddress.new('aldovera@diputados.gov.py') + .unobfuscated + .must_equal 'aldovera@diputados.gov.py' + 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