lib/wildcard_matchers/matchers.rb in wildcard_matchers-0.0.4 vs lib/wildcard_matchers/matchers.rb in wildcard_matchers-0.1.0
- old
+ new
@@ -21,23 +21,14 @@
require "time"
time.is_a?(Time) or (Time.parse(time) rescue false)
end
end
- # RSpeck::Mocks has hash_including
- def hash_includes(*args)
- hash_to_match = {}
- hash_to_match = args.pop if args.last.is_a?(Hash)
-
- lambda do |hash|
- (args - hash.keys).size == 0 &&
- hash_to_match.all? {|key, value| value === hash[key] }
- end
- end
-
def is_a_member_of(*args)
lambda do |item|
args.flatten.any? {|expected| expected === item }
end
end
end
end
+
+require "wildcard_matchers/matchers/hash_includes.rb"