Sha256: 430f097740192f271effaae0622ae74707fc54fc55001309291ae78e7aa6494e
Contents?: true
Size: 562 Bytes
Versions: 61
Compression:
Stored size: 562 Bytes
Contents
require 'mspec/matchers/method' class HavePrivateMethodMatcher < MethodMatcher def matches?(mod) @mod = mod mod.private_methods(@include_super).include? @method end def failure_message ["Expected #{@mod} to have private method '#{@method.to_s}'", "but it does not"] end def negative_failure_message ["Expected #{@mod} NOT to have private method '#{@method.to_s}'", "but it does"] end end class Object def have_private_method(method, include_super=true) HavePrivateMethodMatcher.new method, include_super end end
Version data entries
61 entries across 61 versions & 3 rubygems