Sha256: c0acf10e6b7421cc2b794d7d8883bc0c01fa01a71a44fcc60bf1701ae1684f0e

Contents?: true

Size: 1.51 KB

Versions: 3

Compression:

Stored size: 1.51 KB

Contents

require 'rubygems'

$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
require 'rspec/core'

$LOAD_PATH << File.expand_path('../../../rspec-expectations/lib', __FILE__)
$LOAD_PATH << File.expand_path('../../../rspec-mocks/lib', __FILE__)
require 'rspec/expectations'
require 'rspec/mocks'

begin
  require 'autotest'
rescue LoadError
  raise "Could not load autotest."
end

require 'autotest/rspec2'

Dir['./spec/support/**/*.rb'].map {|f| require f}

module RSpec
  module Core
    module Matchers
      def fail
        raise_error(::RSpec::Expectations::ExpectationNotMetError)
      end

      def fail_with(message)
        raise_error(::RSpec::Expectations::ExpectationNotMetError, message)
      end
    end
  end
end

class NullObject
  def method_missing(method, *args, &block)
    # ignore
  end
end

class RSpec::Core::ExampleGroup
  def self.run_all(reporter=nil)
    run(reporter || NullObject.new)
  end
end

def in_editor?
  ENV.has_key?('TM_MODE') || ENV.has_key?('EMACS') || ENV.has_key?('VIM')
end

RSpec.configure do |c|
  c.color_enabled = !in_editor?
  c.filter_run :focus => true
  c.run_all_when_everything_filtered = true
  c.filter_run_excluding :ruby => lambda {|version|
    case version.to_s
    when "!ruby"
      RUBY_ENGINE != "jruby"
    else
      !(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
    end
  }
  c.before(:each) do
    @real_world = RSpec.world
    RSpec.instance_variable_set(:@world, RSpec::Core::World.new)
  end
  c.after(:each) do
    RSpec.instance_variable_set(:@world, @real_world)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.15 spec/spec_helper.rb
rspec-core-2.0.0.beta.14 spec/spec_helper.rb
rspec-core-2.0.0.beta.13 spec/spec_helper.rb