Change soft-fail to use the config, rather than env
[rbx.git] / mspec / spec / spec_helper.rb
blob5fa0bb54f9dd511bdb2a1ed436aca8ccdcc37603
1 dir_path = File.dirname(__FILE__)
2 lib_path = File.expand_path(dir_path + '/../lib')
3 bin_path = File.expand_path(dir_path + '/..')
4 $:.unshift lib_path unless $:.include? lib_path
5 $:.unshift bin_path unless $:.include? bin_path
7 require 'pp'
8 require 'mspec/helpers/io'
9 require 'mspec/helpers/scratch'
11 # Remove this when MRI has intelligent warnings
12 $VERBOSE = nil unless $VERBOSE
14 class MOSConfig < Hash
15   def initialize
16     self[:includes]  = []
17     self[:requires]  = []
18     self[:flags]     = []
19     self[:options]   = []
20     self[:includes]  = []
21     self[:excludes]  = []
22     self[:patterns]  = []
23     self[:xpatterns] = []
24     self[:tags]      = []
25     self[:xtags]     = []
26     self[:atags]     = []
27     self[:astrings]  = []
28     self[:target]    = 'ruby'
29     self[:command]   = nil
30   end
31 end
33 def new_option
34   config = MOSConfig.new
35   return MSpecOptions.new(config, "spec"), config
36 end
38 # Just to have an exception name output not be "Exception"
39 class MSpecExampleError < Exception
40 end