Sha256: ca5389f9f20ea4e8c315bda6c58cd6075136970564b69150b034530cbef79679

Contents?: true

Size: 386 Bytes

Versions: 20

Compression:

Stored size: 386 Bytes

Contents

describe Integer, "#unitary_perfect?" do
  UNITARY_PERFECT = [6,60,90,87360,146361946186458562560000]

  UNITARY_PERFECT.first(4).each do |n|
    it "should return true for unitary perfect number #{n}" do
      n.should be_unitary_perfect
    end

    m = n + 7
    it "should return false for non-unitary-perfect number #{m}" do
      m.should_not be_unitary_perfect
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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