[rspec-users] why should_receive failure?

Zhenning Guan lists at ruby-forum.com
Tue Jul 14 22:59:22 EDT 2009


class PeepCode

  def awesome
    "awesome"
  end

end

describe PeepCode do

 it "should fuck" do
   PeepCode.new.should_receive(:awesome).and_return("awesome")
 end
end


-----------------------------------------
Spec::Mocks::MockExpectationError in 'PeepCode should fuck'
#<PeepCode:0xb7aa3bbc> expected :awesome with (any args) once, but
received it 0 times
./simple_spec.rb:13:

Finished in 0.006159 seconds

1 example, 1 failure

------------------------------------------


what's wrong with my code?
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list