Sha256: f1e030199d0e6b5177bba1b850993ec2f196fcf764d4486cbe3381a10c8c3c1e
Contents?: true
Size: 810 Bytes
Versions: 12
Compression:
Stored size: 810 Bytes
Contents
module RSpec::RubyContentMatchers class IncludeModule < RSpec::RubyContentMatcher attr_reader :module_name, :type def initialize module_name, type=nil @module_name = module_name.to_s.camelize @type = type || :include end def matches?(content) @content = content (content =~ /#{type}\s+#{module_name}/) end def failure_message super "Expected there to be an inclusion of module #{module_name}" end def negative_failure_message super "Did not expect there to be an inclusion of module #{module_name}" end end def include_module(module_name) IncludeModule.new(module_name) end def extend_module(module_name) IncludeModule.new(module_name, :extend) end end
Version data entries
12 entries across 12 versions & 1 rubygems