Skip to content

Commit

Permalink
Start investigating floere#136, which is probably a theoretically har…
Browse files Browse the repository at this point in the history
…d issue.
  • Loading branch information
floere committed Feb 20, 2014
1 parent 039cc9a commit 93e51b7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/phony/country.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def countrify number
countrify! number || number
end
def countrify! number
number.sub! @countrify_regex, @cc
number.sub! /\A/, @cc # @countrify_regex, @cc
end

# Removes 0s from partially normalized numbers
Expand Down
17 changes: 17 additions & 0 deletions spec/functional/error_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'spec_helper'

describe 'Issues' do

describe '#136' do

it 'is correct for country 39' do
Phony.normalize('+39 393 0000000').should == '393930000000'
end

it 'is correct for country 46' do
Phony.normalize('+46 (0)46 222 0000').should == '46462220000'
end

end

end

0 comments on commit 93e51b7

Please sign in to comment.