Sha256: b876c6ed7767c31c0ffbd0bf21b0ca337b647ce621177d5904bdfab2e6b73431
Contents?: true
Size: 621 Bytes
Versions: 107
Compression:
Stored size: 621 Bytes
Contents
require 'mspec/matchers/method' class HavePrivateInstanceMethodMatcher < MethodMatcher def matches?(mod) @mod = mod mod.private_instance_methods(@include_super).include? @method.to_sym end def failure_message ["Expected #{@mod} to have private instance method '#{@method.to_s}'", "but it does not"] end def negative_failure_message ["Expected #{@mod} NOT to have private instance method '#{@method.to_s}'", "but it does"] end end class Object def have_private_instance_method(method, include_super=true) HavePrivateInstanceMethodMatcher.new method, include_super end end
Version data entries
107 entries across 83 versions & 1 rubygems