Sha256: 1491c55c43e9e23ed21df42b4a32299c926d911032d8b6a9c3e14107db326d89

Contents?: true

Size: 621 Bytes

Versions: 132

Compression:

Stored size: 621 Bytes

Contents

require 'spec_helper'

describe Picky::Generators::Weights::Dynamic do

  context 'defined block' do
    let(:constant) { described_class.new { |str_or_sym| str_or_sym.size } }

    describe '[]' do
      it 'is the length of the given string' do
        constant[''].should == 0
      end
      it 'is the length of the given string' do
        constant['whatevs'].should == 7
      end
      it 'is the length of the given symbol' do
        constant[:whatever].should == 8
      end
    end

    describe 'weight_for' do
      it 'is nil' do
        constant.weight_for(1234).should == nil
      end
    end
  end

end

Version data entries

132 entries across 132 versions & 1 rubygems

Version Path
picky-4.15.0 spec/lib/generators/weights/dynamic_spec.rb
picky-4.14.0 spec/lib/generators/weights/dynamic_spec.rb
picky-4.13.1 spec/lib/generators/weights/dynamic_spec.rb
picky-4.13.0 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.13 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.12 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.11 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.10 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.8 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.7 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.6 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.5 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.4 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.3 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.2 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.1 spec/lib/generators/weights/dynamic_spec.rb
picky-4.12.0 spec/lib/generators/weights/dynamic_spec.rb
picky-4.11.3 spec/lib/generators/weights/dynamic_spec.rb
picky-4.11.2 spec/lib/generators/weights/dynamic_spec.rb
picky-4.11.1 spec/lib/generators/weights/dynamic_spec.rb