Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass clockwork config to Clockwork::Test #7

Merged
merged 1 commit into from
Nov 15, 2015
Merged

Conversation

kevin-j-m
Copy link
Owner

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.

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.
kevin-j-m added a commit that referenced this pull request Nov 15, 2015
Pass clockwork config to Clockwork::Test
@kevin-j-m kevin-j-m merged commit ec982a3 into master Nov 15, 2015
@kevin-j-m kevin-j-m deleted the pass-config-to-test branch November 15, 2015 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant