Skip to content
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
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ jobs:
fail-fast: false
matrix:
ruby_version:
- "2.7"
- "3.2"
include:
- ruby-version: '2.7'
puppet_gem_version: '~> 7.0'
- ruby_version: '3.2'
puppet_gem_version: '~> 8.0'
runs_on:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ jobs:
fail-fast: false
matrix:
ruby_version:
- "2.7"
- "3.2"
include:
- ruby-version: '2.7'
puppet_gem_version: '~> 7.0'
- ruby_version: '3.2'
puppet_gem_version: '~> 8.0'
runs_on:
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inherit_from: .rubocop_todo.yml
inherit_gem:
voxpupuli-rubocop: rubocop.yml

AllCops:
TargetRubyVersion: '3.1'

# Disabled
Style/ClassAndModuleChildren:
Enabled: false
Expand Down
8 changes: 4 additions & 4 deletions lib/rspec-puppet/matchers/create_generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def with(*args)
self
end

def only_with(*args, &block)
def only_with(*args, &)
params = args.shift
@expected_params_count = (@expected_params_count || 0) + params.compact.size
with(params, &block)
with(params, &)
end

def without(*args)
Expand Down Expand Up @@ -62,7 +62,7 @@ def that_comes_before(resource)
self
end

def method_missing(method, *args, &block)
def method_missing(method, *args, &)
case method.to_s
when /^with_/
param = method.to_s.gsub(/^with_/, '')
Expand Down Expand Up @@ -320,7 +320,7 @@ def precedes?(first, second)
before_refs = relationship_refs(u, :before) + relationship_refs(u, :notify)
require_refs = relationship_refs(v, :require) + relationship_refs(u, :subscribe)

return true if before_refs.include?(v.to_ref) || require_refs.include?(u.to_ref) || (before_refs & require_refs).any?
return true if before_refs.include?(v.to_ref) || require_refs.include?(u.to_ref) || before_refs.intersect?(require_refs)
end
end

Expand Down
10 changes: 5 additions & 5 deletions lib/rspec-puppet/matchers/dynamic_matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

module RSpec::Puppet
module ManifestMatchers
def method_missing(method, *args, &block)
def method_missing(method, *args, &)
if /^(create|contain)_/.match?(method.to_s)
return RSpec::Puppet::ManifestMatchers::CreateGeneric.new(method, *args,
&block)
&)
end
if /^have_.+_count$/.match?(method.to_s)
return RSpec::Puppet::ManifestMatchers::CountGeneric.new(nil, args[0],
Expand All @@ -18,16 +18,16 @@ def method_missing(method, *args, &block)
end

module FunctionMatchers
def method_missing(method, *args, &block)
def method_missing(method, *args, &)
return RSpec::Puppet::FunctionMatchers::Run.new if method == :run

super
end
end

module TypeMatchers
def method_missing(method, *args, &block)
return RSpec::Puppet::TypeMatchers::CreateGeneric.new(method, *args, &block) if method == :be_valid_type
def method_missing(method, ...)
return RSpec::Puppet::TypeMatchers::CreateGeneric.new(method, ...) if method == :be_valid_type

super
end
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec-puppet/matchers/raise_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def supports_value_expectations?
end

def raise_error(
error = defined?(RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue) ? RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue : nil, message = nil, &block
error = defined?(RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue) ? RSpec::Matchers::BuiltIn::RaiseError::UndefinedValue : nil, message = nil, &
)
RaiseError.new(error, message, &block)
RaiseError.new(error, message, &)
end
end
end
2 changes: 1 addition & 1 deletion lib/rspec-puppet/matchers/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def failure_message_actual(type)

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

if @has_expected_return
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec-puppet/support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
File.read(path)
elsif File.directory?(path)
# Read and concatenate all .pp files.
Dir[File.join(path, '*.pp')].sort.map do |f|
Dir[File.join(path, '*.pp')].map do |f|

Check warning on line 131 in lib/rspec-puppet/support.rb

View check run for this annotation

Codecov / codecov/patch

lib/rspec-puppet/support.rb#L131

Added line #L131 was not covered by tests
File.read(f)
end.join("\n")
else
Expand Down
2 changes: 1 addition & 1 deletion rspec-puppet.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Gem::Specification.new do |s|
s.authors = ['Tim Sharpe', 'Puppet, Inc.', 'Community Contributors']
s.email = ['[email protected]', '[email protected]']

s.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
s.required_ruby_version = Gem::Requirement.new('>= 3.1.0')
end