~ubuntu-branches/ubuntu/trusty/libmocha-ruby/trusty

« back to all changes in this revision

Viewing changes to lib/mocha/instance_method.rb

  • Committer: Bazaar Package Importer
  • Author(s): Antonio Terceiro
  • Date: 2009-02-15 21:06:03 UTC
  • mfrom: (1.1.3 upstream) (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215210603-vmhi06dceefkxala
Tags: 0.9.5-1
* New upstream release.
* debian/rules:
  - clarified version of GPL
  - added proper copyrigh signs (©)
* debian/control:
  - Added ${misc:Depends} to libmocha-ruby

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
  class InstanceMethod < ClassMethod
6
6
 
7
7
    def method_exists?(method)
8
 
      existing_methods = []
9
 
      existing_methods += stubbee.public_methods(false)
10
 
      existing_methods += stubbee.protected_methods(false)
11
 
      existing_methods += stubbee.private_methods(false)
12
 
      existing_methods.any? { |m| m.to_s == method.to_s }
 
8
      return true if stubbee.public_methods(false).include?(method)
 
9
      return true if stubbee.protected_methods(false).include?(method)
 
10
      return true if stubbee.private_methods(false).include?(method)
 
11
      return false
13
12
    end
14
13
 
15
14
  end