[rspec-devel] [ rspec-Bugs-11075 ] controller specs fail when using mocha without integrated_views
noreply at rubyforge.org
noreply at rubyforge.org
Wed May 23 18:21:43 EDT 2007
Bugs item #11075, was opened at 2007-05-23 22:21
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11075&group_id=797
Category: mock module
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Matthew Deiters (mdeiters)
Assigned to: Nobody (None)
Summary: controller specs fail when using mocha without integrated_views
Initial Comment:
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!'
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11075&group_id=797
More information about the rspec-devel
mailing list