Skip to content

Commit

Permalink
(MAINT) Fix spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chelnak committed May 16, 2022
1 parent 6974248 commit 1f7169a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet_x/puppetlabs/scheduled_task/trigger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def self.to_manifest_hash(i_trigger)
'enabled' => i_trigger.Enabled,
'minutes_interval' => Duration.to_minutes(i_trigger.Repetition.Interval) || 0,
'minutes_duration' => Duration.to_minutes(i_trigger.Repetition.Duration) || 0,
'disable_time_zone_synchronization' => start_boundary ? !/(Z|[+-]\d\d:\d\d)$/.match?(i_trigger.StartBoundary) : false,
'disable_time_zone_synchronization' => start_boundary ? !%r{(Z|[+-]\d\d:\d\d)$}.match?(i_trigger.StartBoundary) : false,
}

case i_trigger.Type
Expand Down
5 changes: 5 additions & 0 deletions spec/unit/puppet_x/puppetlabs/scheduled_task/trigger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,7 @@
},
expected: {
'schedule' => 'once',
'disable_time_zone_synchronization' => false,
},
},
{
Expand All @@ -1036,6 +1037,7 @@
expected: {
'schedule' => 'daily',
'every' => 2,
'disable_time_zone_synchronization' => false,
},
},
{
Expand All @@ -1049,6 +1051,7 @@
'schedule' => 'weekly',
'every' => 2,
'day_of_week' => ['sun', 'mon', 'tues', 'wed', 'thurs', 'fri', 'sat'],
'disable_time_zone_synchronization' => false,
},
},
{
Expand All @@ -1063,6 +1066,7 @@
'schedule' => 'monthly',
'months' => [1],
'on' => (1..31).to_a + ['last'],
'disable_time_zone_synchronization' => false,
},
},
{
Expand All @@ -1080,6 +1084,7 @@
'months' => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
'which_occurrence' => 'last',
'day_of_week' => ['sun', 'mon', 'tues', 'wed', 'thurs', 'fri', 'sat'],
'disable_time_zone_synchronization' => false,
},
},
].each do |trigger_details|
Expand Down

0 comments on commit 1f7169a

Please sign in to comment.