Sha256: 7ea55882ba7836bbcfe05687f2ff1c1e4fd1c19d09db6cd82fabac3381a02acb

Contents?: true

Size: 318 Bytes

Versions: 5

Compression:

Stored size: 318 Bytes

Contents

require 'stubba/class_method'

module Stubba

  class InstanceMethod < ClassMethod
   
    def stub
      raise cannot_replace_method_error unless exists?
      define_new_method
    end
  
    def unstub
      # intentionally empty
    end
  
    def exists?
      object.respond_to?(method)
    end
    
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mocha-0.2.1 lib/stubba/instance_method.rb
mocha-0.2.0 lib/stubba/instance_method.rb
mocha-0.1 lib/stubba/instance_method.rb
mocha-0.1.1 lib/stubba/instance_method.rb
mocha-0.1.2 lib/stubba/instance_method.rb