X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/a12d4f62752f546f57421244e370e79965706ffb..f7aee769411a893c1059c529a220c0d25c72974f:/vendor/plugins/login_engine/test/mocks/time.rb diff --git a/vendor/plugins/login_engine/test/mocks/time.rb b/vendor/plugins/login_engine/test/mocks/time.rb new file mode 100644 index 0000000..e253ada --- /dev/null +++ b/vendor/plugins/login_engine/test/mocks/time.rb @@ -0,0 +1,19 @@ +require 'time' + +Time.class_eval { + if !respond_to? :now_old # somehow this is getting defined many times. + @@advance_by_days = 0 + cattr_accessor :advance_by_days + + class << Time + alias now_old now + def now + if Time.advance_by_days != 0 + return Time.at(now_old.to_i + Time.advance_by_days * 60 * 60 * 24 + 1) + else + now_old + end + end + end + end +}