Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set metadata type attribute to :acceptance so that helper modules and…
… hooks can be set exclusively for acceptance specs without contaminating other specs in the suite. Closes #12
- Loading branch information
Showing
7 changed files
with
86 additions
and
17 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
require 'rspec/core' | ||
|
||
class RSpec::Core::ExampleGroup | ||
class << self | ||
alias scenario example | ||
alias background before | ||
module Steak | ||
module AcceptanceExampleGroup | ||
def self.included(base) | ||
base.instance_eval do | ||
alias scenario example | ||
alias background before | ||
end | ||
end | ||
end | ||
end | ||
|
||
module RSpec::Core::ObjectExtensions | ||
alias feature describe | ||
def feature(*args, &block) | ||
args << {} unless args.last.is_a?(Hash) | ||
args.last.update :type => :acceptance, :steak => true | ||
describe(*args, &block) | ||
end | ||
end | ||
|
||
RSpec.configuration.include Steak::AcceptanceExampleGroup, :type => :acceptance |
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
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