Sha256: 4645e1beae5bce6eca45a3caec23926c0eb6823fa145297b147f22aeaf2a07f0

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

require 'stringio'
require 'rbconfig'

dir = File.dirname(__FILE__)
lib_path = File.expand_path("#{dir}/../lib")
$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
$_spec_spec = true # Prevents Kernel.exit in various places

require 'spec'
require 'spec/mocks'
require 'hpricot' # Needed to compare generated with wanted HTML
spec_classes_path = File.expand_path("#{dir}/../spec/spec/spec_classes")
require spec_classes_path unless $LOAD_PATH.include?(spec_classes_path)

module Spec
  module Matchers
    def fail
      raise_error(Spec::Expectations::ExpectationNotMetError)
    end

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

    class Pass
      def matches?(proc, &block)
        begin
          proc.call
          true
        rescue Exception => @error
          false
        end
      end

      def failure_message
        @error.message + "\n" + @error.backtrace.join("\n")
      end
    end

    def pass
      Pass.new
    end
  end
end

class NonStandardError < Exception; end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-1.0.6 spec/spec_helper.rb
rspec-1.0.7 spec/spec_helper.rb
rspec-1.0.8 spec/spec_helper.rb