Kevin Lochner wrote in post #971805:
> David Chelimsky wrote in post #971793:
>
> Unfortunately that worked:
>
> ThingsHelper
> supports stubs
>
> . . . so there's something weird going on with my app.
It seems that I left out a critical detail :)
I was using incorrect syntax to stub a different method in a before
block:
before do
stub(:some_other_method).and_return(val)
end
Which appears to silently break stubbing. Try the following:
describe ThingsHelper do
it "supports stubs" do
stub!(:bar) {"foobar"}
helper.stub(:foo) { "bar" }
helper.foo.should eq("bar")
end
end
that gives me:
1) ThingsHelper supports stubs
Failure/Error: helper.foo.should eq("bar")
undefined method `foo' for #<ActionView::Base:0x1cef47c>
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users