[rspec-users] why should_receive failure?

Julian Leviston julian at leviston.net
Tue Jul 14 23:32:05 EDT 2009


because
"Peepcode.new"
doesn't receive the "awesome" message.

like it says...

Julian.

On 15/07/2009, at 12:59 PM, Zhenning Guan wrote:

>
> 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/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list