Can anyone suggest me good source (Easy examples) for cucumber and rspec tutorials (rails 3)???
Edit:
Actually I am looking for free online resources with good examples..
RSpec and Cucumber are both testing frameworks. RSpec includes traditional Unit Testing (which means testing a class or part of the application in isolation from the rest of the application. So your model does what your model is supposed to do, the controller does what it is supposed to do, etc).
RSpec is a Behavior-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD.
RSpec is a testing tool for Ruby, created for behavior-driven development (BDD). It is the most frequently used testing library for Ruby in production applications. Even though it has a very rich and powerful DSL (domain-specific language), at its core it is a simple tool which you can start using rather quickly.
Capybara is a framework which allows us to test the code in our views by filling in form data, inspecting page content and sending HTTP requests to the browser. Let's set up a spec to test our newly created form: rails generate rspec:feature form. This will generate the file spec/features/form_spec.rb .
I think the RSpec Book is an excellent resource on Cucumber, RSpec and BDD.
Agree - the RSpec Book provides a wealth of information. I found getting the flow was a big problem in the learning. The book gives you the quick intro, then dives into details and by the time you surface your head will be swimming. It takes a couple of goes of reading the book to get the finer points.
Another great read is a blog post by Sarah Mei called Outside-In BDD. This dialog really help to make things gel since it's demonstrating the application of Cucumber/Rspec in the context of the flow a developer would go through.
Then there is the classics such as the Railscast from Ryan Bates. There are a couple of episodes on Cucumber and other tools and the snippets give you a nice overview after you've soaked up the RSpec book.
For Rspec you can read the Michael Hartl book "Rails 3 tutorial" there is a lot of testing examples : Here the online book
For cucumber, you can watch teachmetocode screencasts (website) . There are good examples using cucumber when building an application from scratch.
Hope it could help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With