Sha256: 00156d05e9eab8967e5c25dee2c60e801fa53ff6b4af1886aa53b8d516a75389

Contents?: true

Size: 962 Bytes

Versions: 5

Compression:

Stored size: 962 Bytes

Contents

#!/usr/bin/env ruby

#---
# Copyright 2003-2013 by Jim Weirich (jim.weirich@gmail.com).
# All rights reserved.

# Permission is granted for use, copying, modification, distribution,
# and distribution of modified versions of this work as long as the
# above copyright notice is included.
#+++



require 'flexmock/base'

class FlexMock
  if defined?(::RSpec)
    SpecModule = RSpec
  else
    SpecModule = Spec
  end

  class RSpecFrameworkAdapter
    def make_assertion(msg, &block)
      msg = msg.call if msg.is_a?(Proc)
      SpecModule::Expectations.fail_with(msg) unless yield
    end

    def check(msg, &block)
      check(msg, &block)
    end

    class AssertionFailedError < StandardError; end

    def assertion_failed_error
      SpecModule::Expectations::ExpectationNotMetError
    end
    def check_failed_error
      assertion_failed_error
    end
  end

  @framework_adapter = RSpecFrameworkAdapter.new
end

require 'flexmock/rspec_spy_matcher'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flexmock-2.0.3 lib/flexmock/rspec.rb
flexmock-2.0.2 lib/flexmock/rspec.rb
flexmock-2.0.1 lib/flexmock/rspec.rb
flexmock-2.0.0 lib/flexmock/rspec.rb
flexmock-2.0.0.rc1 lib/flexmock/rspec.rb