July 2009
July 9, 2009
6:00 - 7:30 PM
Speaker
David W. Body / Big Creek Software, LLC
Topic
Cucumber & Webrat
Cucumber is a tool that lets software developers write descriptions of how software should behave in plain English (or any other natural language). These plain text descriptions can be executed by Cucumber and can serve as automated acceptance tests for the software they describe.
Here is a simple example. Describe a HelloWorld class as follows:
Scenario: HelloWorld says Hello Given An instance of HelloWorld When I send it the say_hello message Then it should say "Hello, Iowa Ruby Brigade!"
Implement the HelloWorld class:
class HelloWorld
def say_hello
"Hello, Iowa Ruby Brigade!"
end
end
After some minor setup, execute the description with Cucumber and you get this output:
Scenario: HelloWorld says Hello Given An instance of HelloWorld When I send it the say_hello message Then it should say "Hello, Iowa Ruby Brigade!" 1 scenario (1 passed) 3 steps (3 passed) 0m0.001s
Although Cucumber is written in Ruby, Cucumber can be used to write descriptions (acceptance tests) for software written in Ruby, Java, or .NET. What's more, Cucumber can be used to describe (test) web applications written in any language.
Topics that will be covered:
- Introduction to Cucumber
- Using Cucumber with RSpec
- Using Cucumber with Ruby on Rails
- Using Cucumber & Webrat with Java web applications
Last updated Jul 01, 2009 at 06:38PM CDT