features/support/env.rb in remi-0.2.25 vs features/support/env.rb in remi-0.2.26
- old
+ new
@@ -3,12 +3,10 @@
require 'bundler/setup'
require 'remi'
require 'remi/cucumber'
-require_relative 'env_app.rb'
-
Remi::Settings.log_level = Logger::ERROR
Before do
# Restart the random number generator prior to each scenario to
# ensure we have reproducibility of random output
@@ -33,5 +31,22 @@
rescue RSpec::Expectations::ExpectationNotMetError => err
puts "Expected error: #{err}"
end
end
end
+
+
+# Fix current time to the first time it is called in a test
+module TimeTesting
+ def current
+ @current_time ||= super
+ end
+end
+
+class Time
+ class << Time
+ prepend TimeTesting
+ end
+end
+
+# Include user-defined environment
+require_relative 'env_app.rb'