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

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