Sounds better indeed.

On Sat, Sep 18, 2010 at 05:14, Alex Boisvert <[email protected]>wrote:

> Antoine, how about:
>
> Gem.source_index.should_receive(:search).at_least(:once).and_return([])
>
> instead of stub?
>
> alex
>
> On Fri, Sep 17, 2010 at 11:16 PM, <[email protected]> wrote:
>
> > Author: toulmean
> > Date: Sat Sep 18 06:16:39 2010
> > New Revision: 998411
> >
> > URL: http://svn.apache.org/viewvc?rev=998411&view=rev
> > Log:
> > stub instead of using should to avoid arity
> >
> > Modified:
> >    buildr/trunk/spec/core/application_spec.rb
> >
> > Modified: buildr/trunk/spec/core/application_spec.rb
> > URL:
> >
> http://svn.apache.org/viewvc/buildr/trunk/spec/core/application_spec.rb?rev=998411&r1=998410&r2=998411&view=diff
> >
> >
> ==============================================================================
> > --- buildr/trunk/spec/core/application_spec.rb (original)
> > +++ buildr/trunk/spec/core/application_spec.rb Sat Sep 18 06:16:39 2010
> > @@ -164,7 +164,7 @@ describe Buildr::Application do
> >
> >     it 'should fail if required gem not found in remote repository' do
> >
> >
> Buildr.application.should_receive(:listed_gems).and_return([Gem::Dependency.new('foo',
> > '>=1.1')])
> > -      Gem.source_index.should_receive(:search).and_return([])
> > +      Gem.source_index.stub!(:search).and_return([])
> >       lambda { Buildr.application.load_gems }.should
> raise_error(LoadError,
> > /cannot be found/i)
> >     end
> >
> >
> >
> >
>

Reply via email to