removed the Proc.new around the timecop-cleanup: now the time is actually reset after each run.

pull/1215/head
Stefan Frank 11 years ago
parent 4c381b99b4
commit 2dd2e3eac7
  1. 6
      features/step_definitions/timecop_steps.rb

@ -44,7 +44,7 @@ end
Given /^the date is "(.*?)"$/ do |date| Given /^the date is "(.*?)"$/ do |date|
new_time = Time.parse date new_time = Time.parse date
Timecop.freeze(new_time) Timecop.travel(new_time)
# Ensure timecop returns after each scenario # Ensure timecop returns after each scenario
Support::ResetTimecop.reset_after Support::ResetTimecop.reset_after
@ -54,9 +54,7 @@ module Support
module ResetTimecop module ResetTimecop
def self.reset_after def self.reset_after
Support::Cleanup.to_clean do Support::Cleanup.to_clean do
Proc.new do Timecop.return
Timecop.return
end
end end
end end
end end

Loading…
Cancel
Save