Sha256: 7630c94409bec0891d578b24248ab95fbb6e6caa7c1b250f245eb512a023c100

Contents?: true

Size: 443 Bytes

Versions: 1

Compression:

Stored size: 443 Bytes

Contents

RSpec::Matchers.define :have_module do |mod_or_name|
  match do |obj|
    !!obj.included_modules.detect { |m| m.to_s == mod_or_name.to_s }
  end

  failure_message_for_should do |obj|
    "expected %p with modules %p to include module '%s'"%[obj, obj.included_modules, mod_or_name]
  end

  failure_message_for_should_not do |obj|
    "expected %p with modules %p to not include module '%s'"%[obj, obj.included_modules, mod_or_name]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
circuit-0.2.0 spec/support/matchers/have_module_matcher.rb