Sha256: d0c2ae8ffc36846ea99da190644d6de46be938226f2bd5b1c3f3380034150596
Contents?: true
Size: 582 Bytes
Versions: 2
Compression:
Stored size: 582 Bytes
Contents
describe Integer, "#heptagonal?" do HEPTAGONAL = [0,1,7,18,34,55,81,112,148,189,235,286,342,403, 469,540,616,697,783,874,970,1071,1177,1288,1404, 1525,1651,1782,1918,2059,2205,2356,2512,2673,2839, 3010,3186,3367,3553,3744,3940,4141,4347,4558,4774, 4995,5221,5452,5688] it "returns true for a heptagonal number" do HEPTAGONAL.each{|n| n.should be_heptagonal} end it "returns false for a non-heptagonal number" do ((0..HEPTAGONAL.last).to_a - HEPTAGONAL).each{|n| n.should_not be_heptagonal} end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
numb-0.21.0 | spec/heptagonal_spec.rb |
numb-0.20.0 | spec/heptagonal_spec.rb |