Sha256: 4fb1f0dbe6410e9b581b217df4598b511698719adbdfb494bf6f054ac0addc2e

Contents?: true

Size: 550 Bytes

Versions: 20

Compression:

Stored size: 550 Bytes

Contents

describe Integer, "#frugal?" do
  # A046759
  @seq = [125,128,243,256,343,512,625,729,1024,1029,1215,
          1250,1280,1331,1369,1458,1536,1681,1701,1715,1792,
          1849,1875,2048,2187,2197,2209,2401,2560,2809,3125,
          3481,3584,3645,3721,4096,4374,4375,4489,4802,
          4913].to_seq
  
  @seq.each do |n|
    it "returns true for frugal number #{n}" do
      n.should be_frugal
    end
  end

  @seq.invert.sample(10).each do |n|
    it "returns false for non-frugal number #{n}" do
      n.should_not be_frugal
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
numb-0.186.0 spec/numb/frugal_spec.rb
numb-0.185.0 spec/numb/frugal_spec.rb
numb-0.184.0 spec/numb/frugal_spec.rb
numb-0.181.0 spec/numb/frugal_spec.rb
numb-0.170.0 spec/numb/frugal_spec.rb
numb-0.152.0 spec/numb/frugal_spec.rb
numb-0.138.0 spec/numb/frugal_spec.rb
numb-0.125.0 spec/numb/frugal_spec.rb
numb-0.114.0 spec/numb/frugal_spec.rb
numb-0.111.0 spec/numb/frugal_spec.rb
numb-0.109.0 spec/numb/frugal_spec.rb
numb-0.99.0 spec/numb/frugal_spec.rb
numb-0.96.0 spec/numb/frugal_spec.rb
numb-0.89.0 spec/numb/frugal_spec.rb
numb-0.84.0 spec/frugal_spec.rb
numb-0.77.0 spec/frugal_spec.rb
numb-0.72.1 spec/frugal_spec.rb
numb-0.72.0 spec/frugal_spec.rb
numb-0.68.0 spec/frugal_spec.rb
numb-0.63.0 spec/frugal_spec.rb