say hello to cucumber
Mon, Nov 9, 2009
BDD is looking good!
fruit-patch Rakefile +- features fruity.feature +- step_definitions fruity_steps.rband what do the fruity contents contain?
require ‘cucumber/rake/task’ Cucumber::Rake::Task.new(:features) task :default => :featuresfruity.feature:
Feature: Fruityness Cucumber is a fruit and not a vegetable!fruity_steps.rb:
Scenario: Say Hello to Cucumber Given that I don’t know Cucumber, say Hello Cucumber!
Given /^that I don’t know Cucumber, say (.*)$/ do |message| puts(message) endand the fruity result:
$ rake … Feature: Tasks Cucumber is a fruit and not a vegetable!Now to apply it to CouchKit.
Scenario: Say Hello to Cucumber # features/test.feature:4 Hello Cucumber! Given that I don’t know Cucumber, say Hello Cucumber! # features/step_definitions/test_steps.rb:1
1 scenario (1 passed) 1 step (1 passed) 0m0.001s