My rule of thumb : Cucumber for integration testing ( output = documentation of features ) and RSpec for unit testing ( output = documentation of code )
On 23 August 2013 03:18, Tamara Temple <tamouse.li...@gmail.com> wrote: > > On Aug 22, 2013, at 4:29 PM, "Jason Hsu, Android developer" < > jhsu802...@gmail.com> wrote: > > > So far, I've been using RSpec for testing my Rails apps simply because > that's what railstutorial.org emphasizes. > > > > However, I am in the process of trying out Cucumber. I like the fact > that it's in plain English, and this is an asset for communicating with > clients or other people who aren't Rubyists. Migrating to Cucumber sounds > like a good idea. > > > > I'm curious about what you prefer. Do any of you know Cucumber well, > yet still prefer RSpec? If so, why? > > Jason, I highly recommend picking up The RSpec Book, published by > Pragmatic Programmers [1]. It discusses both RSpec and Cucumber: when and > how to use both of them. They actually work well together, and complement > each other in many ways. > > For me, RSpec is the way I like to perform unit and functional testing, > while Cucumber, with the Gherkin language, seems ideal for describing and > testing the larger elements of the application, and are quite well suited > to documenting stories as one does in Agile development, and implementing > them to provide acceptance tests for features and releases. Cucumber is > useful also to drive external testing of web applications via Capybara or > Watir, and also for driving command line tools via Aruba. > > So, for me, it's not really one *or* the other, it's both, and deciding > what level of testing is needed and how easy it will be to implement that > test. It is possible, I suppose, to use only one of them, but the level of > detail expressible in RSpec seems to me to be ideal at the lowest level, > and the large scale expressibility with Gherkin makes Cucumber more > relevant to higher levels of abstraction that can be written and read by > non-technical people fairly easily. > > [1] http://pragprog.com/book/achbd/the-rspec-book > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscr...@googlegroups.com. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/71FAB1F2-773F-4257-BD1B-4175066845C1%40gmail.com > . > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ%3Dox-C2hMs3AWFQERsrqP5zGtpxN%3DHwMVtfwUA3o8cXXEnTfA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.