[rspec-users] problem to mock association proxy

Daniel Area Criações danielvlopes at areacriacoes.com.br
Fri Dec 5 15:51:20 EST 2008


Thanks Ashley, you right.
Atenciosamente,

Daniel Lopes    Area Criações
Design, Websites e Sistemas Web

Visite:  http://www.areacriacoes.com.br/projects
          http://blog.areacriacoes.com.br/

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
55 (31) 3077-4560  /  55 (31) 8808-8748  /  55 (31) 8737-7501


On Fri, Dec 5, 2008 at 6:41 PM, Ashley Moran
<ashley.moran at patchspace.co.uk>wrote:

>
> On 5 Dec 2008, at 20:26, Daniel Area Criações wrote:
>
>  This line is only saying that @properties (assigned[:properties]) have
>> some value ... is that?
>> assigns[:properties].should == :user_properties
>>
>> I can change above to assigns[:properties].should_not be_nill and the
>> semantic value will be the same, right?
>>
>
>
> Ah no, the semantic value is different because this would also pass:
>
>  def index
>    @properties = "vegetable soup"
>  end
>
> Yet that does not implement the same behaviour.
>
> When you write a behaviour example, always ask the question "What could I
> realistically write that could pass this but not give the desired
> behaviour?"  That way you will avoid false confidence in specs where the
> behaviour could be broken in the future (perhaps during refactoring), but
> RSpec still reports success.
>
>
> Ashley
>
> --
> http://www.patchspace.co.uk/
> http://aviewfromafar.net/
>
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081205/2056a637/attachment.html>


More information about the rspec-users mailing list