Created
October 20, 2016 16:02
-
-
Save marsz/0426ebbd032b1c664686a901e60b7d8c to your computer and use it in GitHub Desktop.
Monkey patching of RSpec example gruop for document output with gherkin language format
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
# put this file to spec/support/ | |
module RSpec | |
module Core | |
class ExampleGroup | |
def self.Then(*args, &block) | |
args[0] = "Then #{args[0]}" if args[0].is_a?(String) | |
it(*args, &block) | |
end | |
def self.Given(*args, &block) | |
args[0] = "Given #{args[0]}" if args[0].is_a?(String) | |
describe(*args, &block) | |
end | |
def self.When(*args, &block) | |
args[0] = "When #{args[0]}" if args[0].is_a?(String) | |
describe(*args, &block) | |
end | |
def self.Scenario(*args, &block) | |
args[0] = "Scenario: #{args[0]}" if args[0].is_a?(String) | |
describe(*args, &block) | |
end | |
def self.feature(*args, &block) | |
args[0] = "Feature: #{args[0]}" if args[0].is_a?(String) | |
describe(*args, &block) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment