Skip to content

Commit 5d48c03

Browse files
committed
rubocop safe correction
1 parent ea63dbf commit 5d48c03

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

lib/puppet/type/scheduled_task.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ def insync?(current)
271271
end
272272

273273
def should_to_s(new_value = @should)
274-
super(new_value)
274+
super
275275
end
276276

277277
def to_s?(current_value = @is)
278-
super(current_value)
278+
super
279279
end
280280
end
281281

lib/puppet_x/puppet_labs/scheduled_task/task.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#
55
# https://docs.microsoft.com/en-gb/windows/win32/taskschd/task-scheduler-2-0-interfaces
66
#
7-
require_relative './error'
8-
require_relative './trigger'
7+
require_relative 'error'
8+
require_relative 'trigger'
99

1010
# disabling some false positives on the FFI definitions
1111
# rubocop:disable Naming/ClassAndModuleCamelCase,Lint/Void

spec/integration/puppet_x/puppet_labs/scheduled_task/task_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def create_task(task_name = nil, task_compatiblity = nil, triggers = [])
270270
let(:task_name) { name }
271271

272272
it 'and return the same application_name and properties as those originally set' do
273-
expect(subject).to be_exists(task_name)
273+
expect(subject).to exist(task_name)
274274

275275
task = subject.new(task_name)
276276
# verify initial task configuration
@@ -289,7 +289,7 @@ def create_task(task_name = nil, task_compatiblity = nil, triggers = [])
289289

290290
it "#{manifest_hash['schedule']} and return the same properties as those set" do
291291
# verifying task exists guarantees that .new below loads existing task
292-
expect(subject).to be_exists(task_name)
292+
expect(subject).to exist(task_name)
293293

294294
# append the trigger of given type
295295
task = subject.new(task_name)

spec/legacy_taskscheduler.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,7 @@ def account_information
385385
end
386386
end
387387
rescue Puppet::Util::Windows::Error => e
388-
raise e unless e.code == SCHED_E_ACCOUNT_INFORMATION_NOT_SET ||
389-
e.code == SCHED_E_NO_SECURITY_SERVICES ||
390-
e.code == ERROR_NONE_MAPPED
388+
raise e unless [SCHED_E_ACCOUNT_INFORMATION_NOT_SET, SCHED_E_NO_SECURITY_SERVICES, ERROR_NONE_MAPPED].include?(e.code)
391389
end
392390

393391
user

spec/unit/puppet/provider/scheduled_task/win32_taskscheduler_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@
939939
]
940940

941941
expect { provider.validate_trigger(triggers_to_validate) }.to raise_error(
942-
%r{#{Regexp.escape("Unknown day_of_week values(s): [\"BadDay\"]")}},
942+
%r{#{Regexp.escape('Unknown day_of_week values(s): ["BadDay"]')}},
943943
)
944944
end
945945
end

0 commit comments

Comments
 (0)