Sha256: 836f32c6c1083360c38ffb0fac9c2ad0d03828993b5cde6fff3f6de3fd9810b3

Contents?: true

Size: 297 Bytes

Versions: 2

Compression:

Stored size: 297 Bytes

Contents

require 'prime'

describe "Integer.each_prime" do
  it "is transferred to Prime.each" do
    Prime.should_receive(:each).with(100).and_yield(2).and_yield(3).and_yield(5)
    yielded = []
    Integer.each_prime(100) do |prime|
      yielded << prime
    end
    yielded.should == [2,3,5]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubysl-prime-2.0.1 spec/integer/each_prime_spec.rb
rubysl-prime-2.0.0 spec/integer/each_prime_spec.rb