Sha256: 15ebd277c1984dc34ca321f26fb0e50eb52653d190b9b9844292cde4724ae5a9

Contents?: true

Size: 520 Bytes

Versions: 16

Compression:

Stored size: 520 Bytes

Contents

describe Integer, "#carol?" do
  CAROL = [-1,7,47,223,959,3967,16127,65023,261119,1046527,
           4190207,16769023,67092479,268402687,1073676287,
           4294836223,17179607039,68718952447,274876858367,
           1099509530623,4398042316799,17592177655807]

  it "returns true for Carol numbers" do
    CAROL.each do |number|
      number.should be_carol
    end
  end

  it "returns false for non-Carol numbers" do
    ((1..300).to_a - CAROL).each do |number|
      number.should_not be_carol
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
numb-0.21.0 spec/carol_spec.rb
numb-0.20.0 spec/carol_spec.rb
numb-0.10.0 spec/carol_spec.rb
numb-0.9.0 spec/carol_spec.rb
numb-0.8.0 spec/carol_spec.rb
numb-0.7.0 spec/carol_spec.rb
numb-0.6.1 spec/carol_spec.rb
numb-0.6.0 spec/carol_spec.rb
numb-0.5.0 spec/carol_spec.rb
numb-0.4.0 spec/carol_spec.rb
numb-0.3.5 spec/carol_spec.rb
numb-0.3.4 spec/carol_spec.rb
numb-0.3.3 spec/carol_spec.rb
numb-0.3.2 spec/carol_spec.rb
numb-0.3.1 spec/carol_spec.rb
numb-0.3.0 spec/carol_spec.rb