Sha256: 193f346bdf2bbf27cb384476966af5a75eb74c349e1062c00caccf9c1378cbe2
Contents?: true
Size: 756 Bytes
Versions: 21
Compression:
Stored size: 756 Bytes
Contents
#!/usr/bin/ruby # coding: utf-8 require 'mongrel2' unless defined?( Mongrel2 ) ### RSpec matchers for Mongrel2 specs module Mongrel2::Matchers # :nodoc: ### A matcher for unordered array contents class EnumerableAllBeMatcher def initialize( expected_mod ) @expected_mod = expected_mod end def matches?( collection ) collection.all? {|obj| obj.is_a?(@expected_mod) } end def description return "all be a kind of %p" % [ @expected_mod ] end end ############### module_function ############### ### Returns true if the actual value is an Array, all of which respond truly to ### .is_a?( expected_mod ) def all_be_a( expected_mod ) EnumerableAllBeMatcher.new( expected_mod ) end end # module Mongrel2::Matchers
Version data entries
21 entries across 21 versions & 1 rubygems