# File lib/shoulda/assertions.rb, line 23 23: def assert_contains(collection, x, extra_msg = "") 24: collection = [collection] unless collection.is_a?(Array) 25: msg = "#{x.inspect} not found in #{collection.to_a.inspect} #{extra_msg}" 26: case x 27: when Regexp 28: assert(collection.detect { |e| e =~ x }, msg) 29: else 30: assert(collection.include?(x), msg) 31: end 32: end