Created
October 10, 2009 17:35
-
-
Save mrmemes-eth/206969 to your computer and use it in GitHub Desktop.
Gibbon is a monkey patch to provide Given/When/Then templates for RSpec and Webrat integration tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Spec::DSL::Main | |
alias :Feature :describe | |
def Story(description) | |
@description_args.push("\n#{description}\n") | |
end | |
end | |
module Spec::Example::ExampleGroupMethods | |
def executes(scope=:all, &blk) | |
before(scope, &blk) | |
end | |
def Scenario(description, &blk) | |
describe("Scenario: #{description}", &blk) | |
end | |
def Background(description, &blk) | |
describe("Background #{description}", &blk) | |
end | |
def Given(description, &blk) | |
describe("Given #{description}", &blk) | |
end | |
def When(description, &blk) | |
describe("When #{description}", &blk) | |
end | |
def Then(description, &blk) | |
example("Then #{description}", &blk) | |
end | |
def And(description, &blk) | |
example("And #{description}", &blk) | |
end | |
def But(description, &blk) | |
example("But #{description}", &blk) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment