before(:each) do
@myinstance = GetHtml.new
end
it “should be a Hyricot” do
hy = open(‘test.html’) {|f| Hpricot f}
@myinstance.should_receive(:find_html).with(“file:///test_url”).and_return(hy)
end
++++++++++++++++++++++++++++++++++
it “should be a Hyricot” do
hy = open(‘test.html’) {|f| Hpricot f}
@myinstance.stub!(:find_html).with(“file:///test_url”).and_return(hy)
end
++++++++++++++++++++++++++++++++++
expected … once, but received it 0 times
I have a find_html method in my GetHtml class, but why can’t
should_receive run successfuly? but use stub!, it can.