>>
>>       it "should yield the given block" do
>>         @block_yieled = false
>>         create_message_in_factory do |message_delivery|
>>           @block_yieled = true
>>         end
>>         @block_yieled.should be_true
>>       end
>>
>>
>>  Seems kinda hackish, but it did work.  Is this the best way to spec this
>>  or is there already a matcher for this?
>>     
>
> Another approach might be:
>
>     it "should yield the given block" do
>         block_body = mock("block body")
>         block_body.should_receive(:got_here)
>         create_message_in_factory_do | message_delivery |
>             block_body.got_here
>         end
>    end
>
>
>
>
>
>   
Thanks Rick!
Both of these way work but I think they are both too ugly and should be 
created into a more expressive matcher. 
Given the above two options can anyone see an advantage to one way or 
the other?  Or maybe another option is out there that is better?

Thanks,
Ben
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to