kevin-j-m / clockwork-test

A mechanism for testing clockwork jobs
MIT License
43 stars 15 forks source link

Testing 2 clock instances #24

Closed knagode closed 6 years ago

knagode commented 6 years ago

I have 2 clock instances (2 clock.rb files: clock.rb && clock_business_logic_xyz.rb). Everything runs OK but I am not sure how to rspec test both of them.

All tests are checking only tasks in clock.rb file.

Any ideas?

knagode commented 6 years ago

Found it. There is file argument for handling this. Awesome!

Clockwork::Test.run(
   start_time: 18.seconds.ago, 
   end_time: Time.now, 
   tick_speed: 1.second, 
   file: './config/clock_business_logic_xyz.rb'
)
kevin-j-m commented 6 years ago

@knagode this is the second issue asking about specifying the clock file location. Do you have a suggestion for how, or if, we should improve visibility of this option, which is currently documented in the README?

knagode commented 6 years ago

Huh .. I seems like well documented method. Not sure why I didn't see it.