Skip to content

Commit

Permalink
Merge pull request #93 from puppetlabs/maint_fix_rubocop_warnings
Browse files Browse the repository at this point in the history
(maint) Fix rubocop lint warnings
  • Loading branch information
jordanbreen28 authored Dec 5, 2023
2 parents 2f259a6 + 6dae35b commit e114a11
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/rspec-puppet/example/function_example_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def find_function(function_name = self.class.top_level_description)
return func if func.func

if Puppet::Parser::Functions.function(function_name)
V3FunctionWrapper.new(function_name, scope.method("function_#{function_name}".intern))
V3FunctionWrapper.new(function_name, scope.method(:"function_#{function_name}"))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec-puppet/matchers/create_generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def relationship_refs(resource, type, visited = Set.new)

# Add auto* (autorequire etc) if any
if %i[before notify require subscribe].include?(type)
func = "eachauto#{type}".to_sym
func = :"eachauto#{type}"
if resource.resource_type.respond_to?(func)
resource.resource_type.send(func) do |t, b|
Array(resource.to_ral.instance_eval(&b)).each do |dep|
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec-puppet/matchers/type_matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def match_attrs(type, attrs, attr_type)
param = param.to_sym
if attr_type == :feature
baddies.push(param) unless type.provider_feature(param)
elsif !type.send("valid#{attr_type}?".to_sym, param)
elsif !type.send(:"valid#{attr_type}?", param)
baddies.push(param)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/types/valid_provider_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[v[:baddies], v[:baddies].first].each do |baddies|
it "fails for #{baddies.size} baddies" do
expect do
expect(subject).to be_valid_type.send("with_#{k}".to_sym, baddies)
expect(subject).to be_valid_type.send(:"with_#{k}", baddies)
end.to raise_error(
RSpec::Expectations::ExpectationNotMetError,
/Invalid #{k}: #{Array(baddies).join(',')}/
Expand All @@ -29,7 +29,7 @@

[v[:goodies], v[:goodies].first].each do |goodies|
it "passes with #{goodies.size} goodies" do
expect(subject).to be_valid_type.send("with_#{k}".to_sym, goodies)
expect(subject).to be_valid_type.send(:"with_#{k}", goodies)
end
end
end
Expand Down

0 comments on commit e114a11

Please sign in to comment.