Created
July 20, 2009 17:15
-
-
Save tomtt/150453 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | |
| class Bar | |
| def self.search(a, b = {}) | |
| end | |
| end | |
| class Foo | |
| def self.call_bar_stuff | |
| @fish = Bar.search('fish', :limit => 3) | |
| @birds = Bar.search('birds', :limit => 4) | |
| end | |
| end | |
| describe Foo do | |
| before do | |
| Bar.stub!(:search) | |
| end | |
| it "should find no more than 3 fish" do | |
| Bar.should_receive(:search).with('fish', hash_including(:limit => 3)) | |
| Foo.call_bar_stuff | |
| end | |
| it "should find no more than 4 birds" do | |
| Bar.should_receive(:search).with('birds', hash_including(:limit => 4)) | |
| Foo.call_bar_stuff | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment