[Rspec-devel] Skeleton Generator

David Astels dastels at daveastels.com
Mon Aug 14 18:37:10 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 14-Aug-06, at 5:56 PM, Judson Lester wrote:

>
> Swap in this:
>
>   specify "should have 52 cards" do
>     @deck.size.should_equal(52)
>   end
>
> with a corresponding generated Deck#size method.  Then the result is
> that the code gets generated, and there's a failure, because  
> @deck.size
> doesn't return 52.

Granted this is all out of context....

but is the size of a deck part of it's behaviour.. or just part of  
it's state.  Put another way.. does anyone care that they can ask a  
deck for its size?  Or are they more interested in having hands  
dealt, etc?

> There's less room for human error - because you only typed in the  
> method
> name once.  (Granted, there's room for automatic error, if you  
> reference
> a method twice in spec and misspell it the second time...)

true.  A good IDE would help mitigate that, though.

In all some interesting thoughts.

Dave


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFE4PsWauez/L4x7g4RApSsAKCCgTmZkmI4rgb/uPzyqE6Waj8YcgCg44ld
XwKZ0zC/yAaNwe/IyN3OwhE=
=Fo2M
-----END PGP SIGNATURE-----


More information about the Rspec-devel mailing list