Skip to content

Commit 374de81

Browse files
committed
rubocop safe corrections
1 parent ed2774e commit 374de81

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

lib/rspec-puppet/matchers/create_generic.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def with(*args)
3030
self
3131
end
3232

33-
def only_with(*args, &block)
33+
def only_with(*args, &)
3434
params = args.shift
3535
@expected_params_count = (@expected_params_count || 0) + params.compact.size
36-
with(params, &block)
36+
with(params, &)
3737
end
3838

3939
def without(*args)
@@ -62,7 +62,7 @@ def that_comes_before(resource)
6262
self
6363
end
6464

65-
def method_missing(method, *args, &block)
65+
def method_missing(method, *args, &)
6666
case method.to_s
6767
when /^with_/
6868
param = method.to_s.gsub(/^with_/, '')

lib/rspec-puppet/matchers/dynamic_matchers.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
module RSpec::Puppet
44
module ManifestMatchers
5-
def method_missing(method, *args, &block)
5+
def method_missing(method, *args, &)
66
if /^(create|contain)_/.match?(method.to_s)
77
return RSpec::Puppet::ManifestMatchers::CreateGeneric.new(method, *args,
8-
&block)
8+
&)
99
end
1010
if /^have_.+_count$/.match?(method.to_s)
1111
return RSpec::Puppet::ManifestMatchers::CountGeneric.new(nil, args[0],
@@ -18,16 +18,16 @@ def method_missing(method, *args, &block)
1818
end
1919

2020
module FunctionMatchers
21-
def method_missing(method, *args, &block)
21+
def method_missing(method, *args, &)
2222
return RSpec::Puppet::FunctionMatchers::Run.new if method == :run
2323

2424
super
2525
end
2626
end
2727

2828
module TypeMatchers
29-
def method_missing(method, *args, &block)
30-
return RSpec::Puppet::TypeMatchers::CreateGeneric.new(method, *args, &block) if method == :be_valid_type
29+
def method_missing(method, ...)
30+
return RSpec::Puppet::TypeMatchers::CreateGeneric.new(method, ...) if method == :be_valid_type
3131

3232
super
3333
end

lib/rspec-puppet/matchers/raise_error.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ def supports_value_expectations?
1919
end
2020

2121
def raise_error(
22-
error = defined?(RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue) ? RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue : nil, message = nil, &block
22+
error = defined?(RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue) ? RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue : nil, message = nil, &
2323
)
24-
RaiseError.new(error, message, &block)
24+
RaiseError.new(error, message, &)
2525
end
2626
end
2727
end

lib/rspec-puppet/matchers/run.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def failure_message_actual(type)
143143

144144
def failure_message_generic(type, _func_obj)
145145
# message is mutable
146-
message = +"expected #{func_name}(#{func_params}) to "
146+
message = "expected #{func_name}(#{func_params}) to "
147147
message << 'not ' if type == :should_not
148148

149149
if @has_expected_return

0 commit comments

Comments
 (0)