On Thu, Dec 3, 2009 at 4:01 AM, Daniel Varrin <daniel.varrin at gmail.com>
wrote:> Hi,
>
> I''m new to RSpec and installed the version 1.2.9. I was trying to
write some
> of the stories'' examples on the web, but I was not able to let one
run. The
> RDoc contains many examples, but should we write them in a .rb file as is
or
> do we have to copy only the scenario part or what ever?
>
> There is a whole folder of examples with version 1.2.9, but none of them is
> an example about how to create a story or scenario. Am I missing an other
> lib for stories?
RSpec is for specifying lower level specifications.
For stories/scenarios you are probably looking for Cucumber, which is
a separate project which fits together with RSpec like a hand and
glove.
The best way to use them, in my opinion, is in the style of outside in
development, in which you write cucumber features (a collection of
scenarios) to drive out what needs to be implemented, then use RSpec
to do behaviour driven development on those pieces and get the
features to successfully run, then go back and define more features,
rinse and repeat.
There are many blog articles about this, but the best way to
understand it is probably via the RSpec book which is currently under
development and covers both RSpec and Cucumber. Although it''s
pre-production, it''s available under the Pragmatic Programmers beta
program.
http://pragprog.com/titles/achbd/the-rspec-book
--
Rick DeNatale
Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale