View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
Cucumber lets software development teams describe how software should behave in plain text.
Cucumber features are written in a business-readable domain-specific language and serve as:
Cucumber works with Ruby, Java, .Net, Flex, or web apps in any language.
It has been translated into over 30 spoken languages, including lolz.
Cucumber Example Feature: Contact Us As an anonymous user I want to be able to send a message So that I can receive support or get an answer to a question Scenario: Load Form Given I am on "home page" When I follow "Contact Us" Then I should see "Please use the following form" Scenario: Submitting form Given I am on the "contact us page" When I fill in "contact_handler[email]" with "email@example.com" And I fill in "contact_handler[subject]" with "Help" And I fill in "contact_handler[body]" with "Content" And I press "send" Then I should see "Thanks for your message."
RSpec provides a domain specific language with which you can express executable examples of the expected behavior of your code.
RSpec is code centric.
RSpec includes support for mocking and stubbing.
I use it as a replacement for unit and integration testing.
Models and controllers
An RSpec Example You: Describe an account when it is first created. Customer: It should have a balance of $0. describe Account, "when first created" do it "should have a balance of $0" do ... end end When you run this example, RSpec can provide a report like this: Account when first created - should have a balance of $0