Sha256: 8548da58d2a1cb8b144388a7e6ffe6874021945342dea6949aead7a98f1e413c
Contents?: true
Size: 652 Bytes
Versions: 16
Compression:
Stored size: 652 Bytes
Contents
describe Integer, "#maris_mcgwire_sosa_pair?" do MMS = [7,14,43,50,61,63,67,80,84,118,122,134,137,163, 196,212,213,224,241,273,274,277,279,283,351,352, 373,375,390,398,421,457,462,474,475,489,495,510, 516,523,526,537,547,555,558,577,584,590,592,616, 638,644,660,673,687,691] it "returns true for Maris-McGwire-Sosa pairs" do MMS.each do |number| number.maris_mcgwire_sosa_pair?(number+1).should be_true end end it "returns false for non-Maris-McGwire-Sosa pairs" do ((1..200).to_a - MMS).each do |number| number.maris_mcgwire_sosa_pair?(number+1).should be_false end end end
Version data entries
16 entries across 16 versions & 1 rubygems