Sha256: 79d23411534f0998e308db49f2a906808e42a18f17100e27cf8e9d254d08a5be

Contents?: true

Size: 1.18 KB

Versions: 133

Compression:

Stored size: 1.18 KB

Contents

# require 'spec_helper'
#
# describe Picky::Bundle do
#
#   before(:each) do
#     @index            = Picky::Index.new :some_index
#     @category         = Picky::Category.new :some_category, @index
#
#     @partial_strategy = Picky::Generators::Partial::Substring.new :from => 1
#     @exact            = described_class.new :some_name, @category, Picky::Backends::Memory.new, nil, @partial_strategy, nil
#   end
#
#   def generate_random_keys amount
#     alphabet = ('a'..'z').to_a
#     (1..amount).to_a.collect! do |n|
#       Array.new(20).collect! { alphabet[rand(26)] }.join.to_sym
#     end
#   end
#   def generate_random_ids amount
#     (1..amount).to_a.collect! do |_|
#       Array.new(rand(100)+5).collect! do |_|
#         rand(5_000_000)
#       end
#     end
#   end
#
#   describe 'speed' do
#     context 'medium arrays' do
#       before(:each) do
#         random_keys     = generate_random_keys 300
#         random_ids      = generate_random_ids  300
#         @exact.inverted = Hash[random_keys.zip(random_ids)]
#       end
#       it 'should be fast' do
#         performance_of do
#           @exact.generate_partial
#         end.should < 0.1
#       end
#     end
#   end
#
# end

Version data entries

133 entries across 133 versions & 1 rubygems

Version Path
picky-4.11.0 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.10.0 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.9.0 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.8.1 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.8.0 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.7.0 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.6.6 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.6.5 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.6.4 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.6.3 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.6.2 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.6.1 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.6.0 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.5.12 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.5.11 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.5.10 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.5.9 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.5.8 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.5.7 spec/lib/bundle_partial_generation_speed_spec.rb
picky-4.5.6 spec/lib/bundle_partial_generation_speed_spec.rb