diff --git a/lib/rspec-puppet/example/function_example_group.rb b/lib/rspec-puppet/example/function_example_group.rb index df34fb0ea..683612968 100644 --- a/lib/rspec-puppet/example/function_example_group.rb +++ b/lib/rspec-puppet/example/function_example_group.rb @@ -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 diff --git a/lib/rspec-puppet/matchers/create_generic.rb b/lib/rspec-puppet/matchers/create_generic.rb index e849b6f3c..19e4cc33b 100644 --- a/lib/rspec-puppet/matchers/create_generic.rb +++ b/lib/rspec-puppet/matchers/create_generic.rb @@ -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| diff --git a/lib/rspec-puppet/matchers/type_matchers.rb b/lib/rspec-puppet/matchers/type_matchers.rb index 939cd346b..b4ad24d5f 100644 --- a/lib/rspec-puppet/matchers/type_matchers.rb +++ b/lib/rspec-puppet/matchers/type_matchers.rb @@ -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 diff --git a/spec/types/valid_provider_spec.rb b/spec/types/valid_provider_spec.rb index 28b7477df..b5ccfac93 100644 --- a/spec/types/valid_provider_spec.rb +++ b/spec/types/valid_provider_spec.rb @@ -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(',')}/ @@ -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