Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

ExampleGroup helpers to create a dummy class.

  • Loading branch information...
commit d98f888f2b542426a2213d7bff9ee9ef379998cf 1 parent 68b4f57
Justin Ko justinko authored
16 spec/spec_helper.rb
... ... @@ -1,17 +1,17 @@
1 1 require 'mutant'
2 2 require 'aruba/api'
3 3
  4 +Dir['./spec/support/*.rb'].map {|f| require f }
  5 +
4 6 RSpec.configure do |config|
5 7 config.treat_symbols_as_metadata_keys_with_true_values = true
6 8 config.filter_run :focus
7 9 config.run_all_when_everything_filtered = true
8   - config.include Aruba::Api, :example_group => {
9   - :file_path => /spec\/functional/
10   - }
11   - config.before(:each, :example_group => {:file_path => /spec\/functional/}) do
12   - @aruba_timeout_seconds = 5
13   - end
14   - config.after(:each, :example_group => {:file_path => /spec\/functional/}) do
15   - FileUtils.remove_dir('tmp/aruba')
  10 + config.extend ExampleGroupHelpers
  11 +
  12 + {:example_group => {:file_path => /spec\/functional/}}.tap do |options|
  13 + config.include Aruba::Api, options
  14 + config.before(:suite, options) { @aruba_timeout_seconds = 5 }
  15 + config.after(:each, options) { FileUtils.remove_dir('tmp/aruba') }
16 16 end
17 17 end
11 spec/support/example_group_helpers.rb
... ... @@ -0,0 +1,11 @@
  1 +module ExampleGroupHelpers
  2 + def setup_thing(&block)
  3 + before do
  4 + Object.const_set(:Thing, Class.new(&block))
  5 + end
  6 +
  7 + after do
  8 + Object.send(:remove_const, :Thing) if Object.const_defined?(:Thing)
  9 + end
  10 + end
  11 +end

0 comments on commit d98f888

Please sign in to comment.
Something went wrong with that request. Please try again.