Pass clockwork config to Clockwork::Test #7
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This modification ensures that the loading of the clock file will pass
any configuration options set in to Clockwork::Test::Manager.
Previously, when the clock.rb was loaded, the config block was ignored.
This presents an issue when details in the configuration are required to
know if a job should run or not - most prominently with the time zone.
This manifested itself with events not having a timezone configured
when a default TZ was defined in the config. Tests against jobs that
should run at certain times would fail, because the time passed in would
not be parsed at the appropriate timezone in the event, and the event
would assert that it should not run when it should, were the proper
global timezone from the config passed to it.
Test coverage has been added with an acceptance test checking if a job
set to run at a certain time, in a specific timezone associated with the
global config, correctly runs.