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

(maint) Fix rubocop lint warnings #93

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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