Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
ExampleGroup helpers to create a dummy class.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinko committed Feb 9, 2012
1 parent 68b4f57 commit d98f888
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec/spec_helper.rb
@@ -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
11 changes: 11 additions & 0 deletions spec/support/example_group_helpers.rb
@@ -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

0 comments on commit d98f888

Please sign in to comment.