[rspec-users] rspec mocha and controller specs without integrated_views
aslak hellesoy
aslak.hellesoy at gmail.com
Wed May 23 18:19:16 EDT 2007
On 5/24/07, Matt Deiters <mdeiters at msn.com> wrote:
> The ability to choose a mocking framework is great as I prefer mocha, but I
> am have problems.
>
> On my controller specs, I am forced to 'integrate_views' as the following
> code below shows you, the mocking of views is rspec specific. See stub!
> versus mocha's stub
>
> unless block_given?
> unless integrate_views?
> @template.stub!(:file_exists?).and_return(true)
>
> @template.should_receive(:render_template).any_number_of_times.and_return(true)
> { |*args|
> @first_render ||= args[2]
> }
>
> @template.stub!(:find_template_extension_for).and_return("rhtml")
> @template.stub!(:read_template_file).and_return("this is fake
> content generated by rspec")
> end
> end
>
> I am getting the following error: undefined method `stub!'
> Any plans on fixing this?
>
We didn't know about it before you told us.
If you want it fixed fast, send a patch, if not, wait for us to do it.
In any case, a ticket with a failing spec would be great.
Aslak
> Matt
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
More information about the rspec-users
mailing list