Skip to content
This repository was archived by the owner on Apr 17, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/data_mapper/validation/rule/formats/email.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Formats
end
digit = '0-9'
atext = "[#{letter}#{digit}\!\#\$\%\&\'\*+\/\=\?\^\_\`\{\|\}\~\-]"
dot_atom_text = "#{atext}+([.]#{atext}*)+"
dot_atom_text = "#{atext}+([.]#{atext}+)+"
dot_atom = dot_atom_text
no_ws_ctl = '\x01-\x08\x11\x12\x14-\x1f\x7f'
qtext = "[^#{no_ws_ctl}\\x0d\\x22\\x5c]" # Non-whitespace, non-control character except for \ and "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ def valid_attributes
'Job@Book of Job',
'test@localhost',
'J. P. \'s-Gravezande, a.k.a. The Hacker!@example.com',
"test@example.com\nsomething after the newline"].each do |email|
"test@example.com\nsomething after the newline",
'mal.@example.com',
'mal.formed.@example.com',
'mal.formed@example.',
'mal.formed@example.com.',
'mal.formed@example...com'].each do |email|
describe "with email value of #{email} (non RFC2822 compliant)" do
before :all do
@model = DataMapper::Validations::Fixtures::BillOfLading.new(valid_attributes.merge(:email => email))
Expand Down