Sha256: a6b1c34c7833c0c004c93621041e0671b1eb01dcf8ca1fbce56e6d334e301838
Contents?: true
Size: 873 Bytes
Versions: 2
Compression:
Stored size: 873 Bytes
Contents
module RSpec module RubyContentMatchers class IncludeModule attr_reader :module_name def initialize module_name @module_name = module_name end def matches?(content) @content = content match_res = (@content =~ /include\s+#{module_name}/) if block_given? && match_res ruby_content = content.extend(RSpec::RubyContent::Helpers) yield ruby_content else match_res end end def failure_message "Expected there to be an inclusion of module #{module_name}" end def negative_failure_message "Did not expect there to be an inclusion of module #{module_name}" end end def include_module(module_name) IncludeModule.new(module_name) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rspec_for_generators-0.2.1 | lib/rspec_for_generators/matchers/content/include_module.rb |
rspec_for_generators-0.2.0 | lib/rspec_for_generators/matchers/content/include_module.rb |