This repository has been archived by the owner on Jun 2, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ExampleGroup helpers to create a dummy class.
- Loading branch information
Showing
2 changed files
with
19 additions
and
8 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,17 +1,17 @@ | |||
require 'mutant' | require 'mutant' | ||
require 'aruba/api' | require 'aruba/api' | ||
|
|
||
Dir['./spec/support/*.rb'].map {|f| require f } | |||
|
|||
RSpec.configure do |config| | RSpec.configure do |config| | ||
config.treat_symbols_as_metadata_keys_with_true_values = true | config.treat_symbols_as_metadata_keys_with_true_values = true | ||
config.filter_run :focus | config.filter_run :focus | ||
config.run_all_when_everything_filtered = true | config.run_all_when_everything_filtered = true | ||
config.include Aruba::Api, :example_group => { | config.extend ExampleGroupHelpers | ||
:file_path => /spec\/functional/ |
|
||
} | {:example_group => {:file_path => /spec\/functional/}}.tap do |options| | ||
config.before(:each, :example_group => {:file_path => /spec\/functional/}) do | config.include Aruba::Api, options | ||
@aruba_timeout_seconds = 5 | config.before(:suite, options) { @aruba_timeout_seconds = 5 } | ||
end | config.after(:each, options) { FileUtils.remove_dir('tmp/aruba') } | ||
config.after(:each, :example_group => {:file_path => /spec\/functional/}) do | |||
FileUtils.remove_dir('tmp/aruba') | |||
end | end | ||
end | end |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
module ExampleGroupHelpers | |||
def setup_thing(&block) | |||
before do | |||
Object.const_set(:Thing, Class.new(&block)) | |||
end | |||
|
|||
after do | |||
Object.send(:remove_const, :Thing) if Object.const_defined?(:Thing) | |||
end | |||
end | |||
end |