Permalink
Browse files

speed tests

  • Loading branch information...
1 parent 0acd348 commit cf54d16a179038f41ae01bb4cbce3cf857661b2e @kbingman kbingman committed Feb 11, 2011
Showing with 38 additions and 38 deletions.
  1. +38 −38 spec/lib/phony_spec.rb
View
@@ -294,44 +294,44 @@
end
end
- # context "speed" do
- # before(:each) do
- # @phone_numbers = [
- # '41443643532',
- # '18091231234',
- # '43198110',
- # '33142278186',
- # '4233841148'
- # ]
- # end
- # describe 'split' do
- # it 'is fast' do
- # number = @phone_numbers.first
- # performance_of { Phony.split(number) }.should < 0.00005
- # end
- # 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
- # number = @phone_numbers.first
- # performance_of { Phony.normalize(number) }.should < 0.0001
- # end
- # it 'is fast' do
- # performance_of { @phone_numbers.each { |number| Phony.normalize(number) } }.should < 0.00016
- # end
- # end
- # describe 'formatted' do
- # it 'is fast' do
- # number = @phone_numbers.first
- # performance_of { Phony.formatted(number) }.should < 0.000075
- # end
- # it 'is fast' do
- # performance_of { @phone_numbers.each { |number| Phony.formatted(number) } }.should < 0.00016
- # end
- # end
- # end
+ context "speed" do
+ before(:each) do
+ @phone_numbers = [
+ '41443643532',
+ '18091231234',
+ '43198110',
+ '33142278186',
+ '4233841148'
+ ]
+ end
+ describe 'split' do
+ it 'is fast' do
+ number = @phone_numbers.first
+ performance_of { Phony.split(number) }.should < 0.00005
+ end
+ 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
+ number = @phone_numbers.first
+ performance_of { Phony.normalize(number) }.should < 0.0001
+ end
+ it 'is fast' do
+ performance_of { @phone_numbers.each { |number| Phony.normalize(number) } }.should < 0.00016
+ end
+ end
+ describe 'formatted' do
+ it 'is fast' do
+ number = @phone_numbers.first
+ performance_of { Phony.formatted(number) }.should < 0.000075
+ end
+ it 'is fast' do
+ performance_of { @phone_numbers.each { |number| Phony.formatted(number) } }.should < 0.00016
+ end
+ end
+ end
describe 'vanity' do
describe 'vanity_number?' do

0 comments on commit cf54d16

Please sign in to comment.