Hi Steve,

I wrote the spec first and then the implementation. I think I could
have written a better behavior description. I don't think the method
name is as good or specific as it could be. I just wanted the class to
be able to add two numbers... so maybe the specification could reflect
that more... and I want the class to add two numbers because I wanted
to practice using rspec and figured a simple program would be good to
start out with.


- Calvin

On Sep 21, 7:47 pm, Stephen Eley <sfe...@gmail.com> wrote:
> On Mon, Sep 21, 2009 at 5:48 PM, Calvin <cstephe...@gmail.com> wrote:
>
> > I am pretty new to RSpec and I wonder if some code I have written is
> > leading me in the right direction. Any advice is greatly appreciated!
>
> As a beginner exercise, this code looks perfectly functional to me.
> But I believe you left out the interesting parts:
>
> * Which did you write first?  The spec or the implementation?
>
> * Is the behavior description, "it should perform calculations," clear
> and precise?  If I didn't have access to the code, would I be able to
> read that description and know something useful about the class's
> behavior?
>
> * Why did you choose the method name "equation"?  If I simply knew
> that name, would I be able to tell what that method does?
>
> * What is it you _really_ want this class to do?  Does the
> specification help you verify that it acts according to your
> intention?
>
> * Why do you want it to do that?  (Okay, granted, this may be more of
> a Cucumber question than an RSpec question.)  >8->
>
> --
> Have Fun,
>    Steve Eley (sfe...@gmail.com)
>    ESCAPE POD - The Science Fiction Podcast Magazine
>    http://www.escapepod.org
> _______________________________________________
> rspec-users mailing list
> rspec-us...@rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to