Skip to content

Instantly share code, notes, and snippets.

@mrmemes-eth
Created October 10, 2009 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mrmemes-eth/206969 to your computer and use it in GitHub Desktop.
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
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