Created
February 15, 2012 22:59
-
-
Save carlosantoniodasilva/1839841 to your computer and use it in GitHub Desktop.
RSpec - Register Example Group
This file contains hidden or 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 Support | |
module WorkerExampleGroup | |
include RSpec::Rails::RailsExampleGroup | |
def self.included(base) | |
base.metadata[:type] = :worker | |
end | |
end | |
end | |
RSpec.configure do |config| | |
config.include Support::WorkerExampleGroup, :type => :worker, | |
:example_group => { :file_path => config.escaped_path(%w[spec workers]) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm adding a spec/workers dir for specific worker specs, which are mainly supposed to deal with background jobs, and I want to be able to include some shared helpers to them using
config.include Support::MyHelpers, type: :worker
. I based this code onrspec-rails
example groups.