Sha256: cf3e24a60f2bebe006c026849b0392256ef65e20f3a8c5e7258bfcc7cdd74424

Contents?: true

Size: 684 Bytes

Versions: 9

Compression:

Stored size: 684 Bytes

Contents

require 'stringio'
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
require 'spec'
require File.dirname(__FILE__) + '/../spec/spec/spec_classes'

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 => @error
          false
        end
      end

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

    def pass
      Pass.new
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
riess-0.0.8 vendor/rspec-0.8.2/spec/spec_helper.rb
rspec-0.8.0 spec/spec_helper.rb
rspec-0.8.1 spec/spec_helper.rb
rspec-0.9.1 spec/spec_helper.rb
rspec-0.9.2 spec/spec_helper.rb
rspec-0.9.3 spec/spec_helper.rb
rspec-0.8.2 spec/spec_helper.rb
rspec-0.9.0 spec/spec_helper.rb
rspec-0.9.4 spec/spec_helper.rb