lib/muack/satisfy.rb in muack-0.7.2 vs lib/muack/satisfy.rb in muack-0.7.3
- old
+ new
@@ -68,9 +68,16 @@
super lambda{ |actual_arg|
actual_arg.values_at(*hash.keys) == hash.values }, [hash]
end
end
+ class Including < Satisfy
+ def initialize element
+ super lambda{ |actual_arg|
+ actual_arg.include?(element) }, [element]
+ end
+ end
+
class Within < Satisfy
def initialize range_or_array
super lambda{ |actual_arg| range_or_array.include?(actual_arg) },
[range_or_array]
end