On Mon, Oct 12, 2009 at 5:03 PM, Ashley Moran
wrote:
>
> This is a common mistake, and one I made for a long while even after being
> familiar with RSpec. I wonder if there is justification for an AST pass
> over spec files to catch this (among possibly other issues)?
The AST pass over the spec
On Mon, Oct 12, 2009 at 3:18 PM, Tero Tilus wrote:
> 2009-10-12 11:33, Willy Mene:
>> I've tried searching around for something describing how the #should
>> method works with the != operator
>
> Afaik it doesn't. I have led to believe this is because there is no
> method '!='. Expression x!=y i
> "Randy" == Randy Harmon writes:
Randy> Hi Cliff, Hey, that's a good use case - one I hadn't
Randy> considered. Just goes to show you, the real world has a
Randy> way of intruding on happy theories. :) It's nice to hear
Randy> feedback about the matcher.
It's so good that
Hi Cliff,
Hey, that's a good use case - one I hadn't considered. Just goes to
show you, the real world has a way of intruding on happy theories. :)
It's nice to hear feedback about the matcher.
which_generates() as a method on the route_to() matcher seems like it
should work to me, once it's w
Hi Cliff,
Hey, that's a good use case - one I hadn't considered. Just goes to
show you, the real world has a way of intruding on happy theories. :)
It's nice to hear feedback about the matcher.
which_generates() as a method on the route_to() matcher seems like it
should work to me, once it's w
Sam,
As the .any_instance call suggests, anything ever again for the duration of
the test will stub that value, the alternative is this:
Foo.any_instance.stubs(:valid?).returns(false)
replace with this
foo = Foo.new
foo.stubs(:valid?).returns(false)
HTH
- Lee
_
I like the new route_to matcher, but I can't use it for my root route,
since the route that is generated isn't the route that I pass in.
Specifically, my routes.rb has:
...
map.resources :skills, :only => [:index, :show]
...
map.root :controller => :skills, :action => :index, :conditions =
Things seem to be working better now that I am using just Mocha,
however, I am still having problems with
Foo.any_instance.stubs(:valid?).returns(false). I later tests, valid is
still stubbed out to be false. How to I stub something for exactly the
duration of one example?
Thanks,
Sam
--
Po