Skip to content

Instantly share code, notes, and snippets.

@CoryFoy
Created January 10, 2015 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CoryFoy/7d5d02234732df39adde to your computer and use it in GitHub Desktop.
Save CoryFoy/7d5d02234732df39adde to your computer and use it in GitHub Desktop.
describe "Mock Each" do
it "mocks it" do
a = []
a.should_receive(:each).and_yield('b')
b = []
a.each { |c| b.push(c) }
expect(b.length).to eq 1
expect(b.first).to eq 'b'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment