lib/clockwork_mocks.rb in clockwork-mocks-1.2.0 vs lib/clockwork_mocks.rb in clockwork-mocks-1.3.0

- old
+ new

@@ -9,15 +9,27 @@ module ClockworkMocks def self.init_rspec(allow, receive, clock_file = nil, &block) scheduler.init_rspec(allow, receive, clock_file, &block) end + def self.reset_rspec(allow, receive, clock_file = nil, &block) + if scheduler.tasks.empty? + init_rspec(allow, receive, clock_file, &block) + else + reset! + end + end + def self.scheduler @scheduler ||= Scheduler.new end def self.reset! scheduler.reset! + end + + def self.reset_scheduler_instance! + @scheduler = nil end def self.work scheduler.work end