Skip to content

Commit

Permalink
+ more speed specs
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Nov 19, 2010
1 parent a050691 commit eda887f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions spec/lib/phony_spec.rb
Expand Up @@ -171,7 +171,7 @@
end end
end end


describe "speed" do context "speed" do
before(:each) do before(:each) do
@phone_numbers = [ @phone_numbers = [
'41443643532', '41443643532',
Expand All @@ -181,8 +181,20 @@
'4233841148' '4233841148'
] ]
end end
it 'is fast' do describe 'split' do
performance_of { @phone_numbers.each { |number| Phony.split(number) } }.should < 0.0002 it 'is fast' do
performance_of { @phone_numbers.each { |number| Phony.split(number) } }.should < 0.00015
end
end
describe 'normalize' do
it 'is fast' do
performance_of { @phone_numbers.each { |number| Phony.normalize(number) } }.should < 0.00015
end
end
describe 'formatted' do
it 'is fast' do
performance_of { @phone_numbers.each { |number| Phony.formatted(number) } }.should < 0.00015
end
end end
end end


Expand Down

0 comments on commit eda887f

Please sign in to comment.