Sha256: 8122063f2a07fbc3ca793727d3bec9e53e947b22f9f0be9ace6b9dc8511690c6
Contents?: true
Size: 831 Bytes
Versions: 6
Compression:
Stored size: 831 Bytes
Contents
# frozen_string_literal: true module ConvenientService module RSpec module PrimitiveMatchers module Classes class ExtendModule ## # NOTE: `mod` since `module` is a keyword. # def initialize(mod) @mod = mod end def matches?(klass) @klass = klass klass.singleton_class.included_modules.include?(mod) end def description "extend module `#{mod}`" end def failure_message "expected `#{klass}` to extend module `#{mod}`" end def failure_message_when_negated "expected `#{klass}` NOT to extend module `#{mod}`" end private attr_reader :klass, :mod end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems