Sha256: 90fc0aaceb7d729005c5f1f3ee6fcddcfa522ee0af657cf582e97785adf11699

Contents?: true

Size: 570 Bytes

Versions: 16

Compression:

Stored size: 570 Bytes

Contents

describe Integer, "#woodall?" do
  # A003261
  @seq = [1,7,23,63,159,383,895,2047,4607,10239,22527,
          49151,106495,229375,491519,1048575,2228223,
          4718591,9961471,20971519,44040191,92274687,
          192937983,402653183,838860799,1744830463,
          3623878655,7516192767].to_seq

  @seq.sample(5).each do |n|
    it "should return true for Woodall number #{n}" do
      n.should be_woodall
    end
  end

  @seq.invert.sample(5).each do |n|
    it "should return false for non-Woodall number #{n}" do
      n.should_not be_woodall
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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