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