Sha256: 63f3080bc2774f687fc645af36dea952c4965f32f3cee4b8b4c9ab3e262782f4

Contents?: true

Size: 514 Bytes

Versions: 47

Compression:

Stored size: 514 Bytes

Contents

require 'spec_helper'

describe Picky::Generators::Weights::Logarithmic do

  let(:logarithmic) { described_class.new }

  describe 'saved?' do
    it 'is correct' do
      logarithmic.saved?.should == true
    end
  end

  describe 'weight_for' do
    it 'is 0 for 0' do
      logarithmic.weight_for(0).should == 0
    end
    it 'is 0 for 1' do
      logarithmic.weight_for(1).should == 0
    end
    it 'is log(x) for x' do
      logarithmic.weight_for(1234).should == Math.log(1234).round(3)
    end
  end

end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
picky-4.0.8 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.7 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.6 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.5 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.4 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.3 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.1 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.0 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.0pre6 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.0pre5 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.0pre3 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.0pre2 spec/lib/generators/weights/logarithmic_spec.rb
picky-4.0.0pre1 spec/lib/generators/weights/logarithmic_spec.rb
picky-3.6.16 spec/lib/generators/weights/logarithmic_spec.rb
picky-3.6.15 spec/lib/generators/weights/logarithmic_spec.rb
picky-3.6.14 spec/lib/generators/weights/logarithmic_spec.rb
picky-3.6.13 spec/lib/generators/weights/logarithmic_spec.rb
picky-3.6.12 spec/lib/generators/weights/logarithmic_spec.rb
picky-3.6.11 spec/lib/generators/weights/logarithmic_spec.rb
picky-3.6.10 spec/lib/generators/weights/logarithmic_spec.rb