Created
January 10, 2015 21:08
-
-
Save CoryFoy/7d5d02234732df39adde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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