Sha256: abc23ea47d6d6fd603f975ee3a76b184b6146de0e8c504105c5565d144ffe9dc

Contents?: true

Size: 450 Bytes

Versions: 22

Compression:

Stored size: 450 Bytes

Contents

require 'mocha/api'

module Mocha
  module Integration
    module MonkeyPatcher
      def self.apply(mod, run_method_patch)
        unless mod < Mocha::API
          mod.send(:include, Mocha::API)
        end
        unless mod.method_defined?(:run_before_mocha)
          mod.send(:alias_method, :run_before_mocha, :run)
          mod.send(:remove_method, :run)
          mod.send(:include, run_method_patch)
        end
      end
    end
  end
end

Version data entries

22 entries across 18 versions & 5 rubygems

Version Path
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/mocha-1.0.0/lib/mocha/integration/monkey_patcher.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/mocha-1.0.0/lib/mocha/integration/monkey_patcher.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/mocha-1.0.0/lib/mocha/integration/monkey_patcher.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/mocha-1.0.0/lib/mocha/integration/monkey_patcher.rb
mocha-1.1.0 lib/mocha/integration/monkey_patcher.rb
mocha-1.0.0 lib/mocha/integration/monkey_patcher.rb
mocha-1.0.0.alpha lib/mocha/integration/monkey_patcher.rb
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/mocha-0.14.0/lib/mocha/integration/monkey_patcher.rb
challah-1.0.0 vendor/bundle/gems/mocha-0.14.0/lib/mocha/integration/monkey_patcher.rb
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/mocha-0.14.0/lib/mocha/integration/monkey_patcher.rb
mocha-0.14.0 lib/mocha/integration/monkey_patcher.rb
challah-1.0.0.beta3 vendor/bundle/gems/mocha-0.13.3/lib/mocha/integration/monkey_patcher.rb
mocha-0.14.0.alpha lib/mocha/integration/monkey_patcher.rb
challah-1.0.0.beta2 vendor/bundle/gems/mocha-0.13.3/lib/mocha/integration/monkey_patcher.rb
challah-1.0.0.beta vendor/bundle/gems/mocha-0.13.3/lib/mocha/integration/monkey_patcher.rb
mocha-0.13.3 lib/mocha/integration/monkey_patcher.rb
mocha-0.13.2 lib/mocha/integration/monkey_patcher.rb
mocha-0.13.1 lib/mocha/integration/monkey_patcher.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/mocha-0.13.0/lib/mocha/integration/monkey_patcher.rb
challah-rolls-0.2.0 vendor/bundle/gems/mocha-0.13.0/lib/mocha/integration/monkey_patcher.rb