# File lib/shoulda/context/assertions.rb, line 37 def assert_does_not_contain(collection, x, extra_msg = "") collection = Array(collection) msg = "#{x.inspect} found in #{collection.to_a.inspect} " + extra_msg case x when Regexp assert(!collection.detect { |e| e =~ x }, msg) else assert(!collection.include?(x), msg) end end