lib/ensurance/time_ensure.rb in ensurance-0.1.6 vs lib/ensurance/time_ensure.rb in ensurance-0.1.7
- old
+ new
@@ -33,9 +33,18 @@
else
raise ArgumentError.new("Unhandled Type for Time to ensure: #{thing.class}")
end
end
end
+
+ def ensure!(thing)
+ def ensure!(thing)
+ result = self.ensure(thing)
+ raise ArgumentError, "Cannot Time.ensure(#{thing})" unless result
+ result
+ end
+ end
+
end
end
end