diff --git a/.rubocop.yml b/.rubocop.yml index d95f483be..c73c846aa 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,18 +1,8 @@ +--- inherit_from: .rubocop_todo.yml -require: - - rubocop-performance - - rubocop-rspec - -AllCops: - Exclude: - - Gemfile - - Rakefile - - spec/fixtures/**/* - - vendor/bundle/**/* - NewCops: enable - SuggestExtensions: false - TargetRubyVersion: '2.7' +inherit_gem: + voxpupuli-rubocop: rubocop.yml # Disabled Style/ClassAndModuleChildren: @@ -20,11 +10,3 @@ Style/ClassAndModuleChildren: Layout/LineLength: Max: 200 - -#################################################### -# Cops below here due for deprecation -#################################################### -# ``Rspec/FilePath`` is going to be deprecated in the next major release of rubocop >=3.0.0: see -# As the new cops are already present, e.g., Rspec/SpecFilePathPathFormat, then disabling this in preparation -Gemspec/RequireMFA: - Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e9822e6d9..2f46ec848 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-01-22 15:56:59 UTC using RuboCop version 1.50.2. +# on 2024-07-05 20:35:14 UTC using RuboCop version 1.64.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -26,11 +26,17 @@ Lint/EmptyBlock: - 'spec/unit/adapters_spec.rb' # Offense count: 3 +# Configuration parameters: AllowedParentClasses. Lint/MissingSuper: Exclude: - 'lib/rspec-puppet/errors.rb' - 'lib/rspec-puppet/sensitive.rb' +# Offense count: 1 +Lint/MixedRegexpCaptureTypes: + Exclude: + - 'Gemfile' + # Offense count: 1 Lint/RescueException: Exclude: @@ -50,64 +56,20 @@ Lint/SuppressedException: # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. +# Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. Lint/UnusedMethodArgument: Exclude: - 'lib/rspec-puppet/support.rb' # Offense count: 5 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect. Lint/UselessAssignment: Exclude: - 'lib/rspec-puppet/example/function_example_group.rb' - 'lib/rspec-puppet/matchers/create_generic.rb' - 'lib/rspec-puppet/monkey_patches.rb' -# Offense count: 27 -# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. -Metrics/AbcSize: - Max: 59 - -# Offense count: 7 -# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. -# AllowedMethods: refine -Metrics/BlockLength: - Max: 111 - -# Offense count: 1 -# Configuration parameters: CountBlocks. -Metrics/BlockNesting: - Max: 4 - -# Offense count: 6 -# Configuration parameters: CountComments, CountAsOne. -Metrics/ClassLength: - Max: 297 - -# Offense count: 18 -# Configuration parameters: AllowedMethods, AllowedPatterns. -Metrics/CyclomaticComplexity: - Max: 18 - -# Offense count: 47 -# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. -Metrics/MethodLength: - Max: 53 - -# Offense count: 2 -# Configuration parameters: CountComments, CountAsOne. -Metrics/ModuleLength: - Max: 383 - -# Offense count: 2 -# Configuration parameters: CountKeywordArgs, MaxOptionalParameters. -Metrics/ParameterLists: - Max: 9 - -# Offense count: 13 -# Configuration parameters: AllowedMethods, AllowedPatterns. -Metrics/PerceivedComplexity: - Max: 20 - # Offense count: 2 Naming/AccessorMethodName: Exclude: @@ -125,6 +87,7 @@ Naming/ConstantName: # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS Naming/FileName: Exclude: + - 'Rakefile.rb' - 'lib/rspec-puppet.rb' - 'spec/functions/camelCaseFunction_spec.rb' @@ -138,6 +101,7 @@ Naming/HeredocDelimiterNaming: - 'spec/unit/matchers/compile_spec.rb' # Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: @@ -199,6 +163,12 @@ RSpec/DescribeClass: RSpec/ExampleLength: Max: 12 +# Offense count: 16 +# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. +# Include: **/*_spec*rb*, **/spec/**/* +RSpec/FilePath: + Enabled: false + # Offense count: 2 RSpec/ImplicitBlockExpectation: Exclude: @@ -232,7 +202,7 @@ RSpec/MultipleDescribes: - 'spec/unit/example/function_example_group_spec.rb' - 'spec/unit/monkey_patches_spec.rb' -# Offense count: 45 +# Offense count: 49 RSpec/MultipleExpectations: Max: 8 @@ -241,7 +211,7 @@ RSpec/MultipleExpectations: RSpec/MultipleMemoizedHelpers: Max: 7 -# Offense count: 263 +# Offense count: 274 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. # SupportedStyles: always, named_only RSpec/NamedSubject: @@ -323,6 +293,12 @@ RSpec/VerifiedDoubles: - 'spec/unit/matchers/allow_value_spec.rb' - 'spec/unit/sensitive_spec.rb' +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +Rake/Desc: + Exclude: + - 'Rakefile' + # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowOnConstant, AllowOnSelfClass. @@ -336,6 +312,7 @@ Style/ClassVars: - 'lib/rspec-puppet/support.rb' # Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). Style/CombinableLoops: Exclude: - 'spec/classes/catalogue_cache_spec.rb' @@ -353,6 +330,23 @@ Style/FormatString: Exclude: - 'lib/rspec-puppet/coverage.rb' +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Exclude: + - 'Gemfile' + - 'Rakefile' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedReceivers. +# AllowedReceivers: Thread.current +Style/HashEachMethods: + Exclude: + - 'Rakefile' + # Offense count: 14 # This cop supports safe autocorrection (--autocorrect). Style/IfUnlessModifier: @@ -390,6 +384,14 @@ Style/SlicingWithRange: Exclude: - 'lib/rspec-puppet/monkey_patches.rb' +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: RequireEnglish, EnforcedStyle. +# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names +Style/SpecialGlobalVars: + Exclude: + - 'Rakefile' + # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Mode. diff --git a/Gemfile b/Gemfile index f513ad7e6..6252a780e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,12 @@ -source ENV['GEM_SOURCE'] || "https://rubygems.org" +# frozen_string_literal: true + +source ENV['GEM_SOURCE'] || 'https://rubygems.org' gemspec def location_for(place_or_version, fake_version = nil) - git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} - file_url_regex = %r{\Afile:\/\/(?.*)} + git_url_regex = /\A(?(https?|git)[:@][^#]*)(#(?.*))?/ + file_url_regex = %r{\Afile://(?.*)} if place_or_version && (git_url = place_or_version.match(git_url_regex)) [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact @@ -16,15 +18,14 @@ def location_for(place_or_version, fake_version = nil) end group :development do + gem 'fuubar' gem 'pry' gem 'pry-stack_explorer' - gem 'fuubar' end group :test do - - gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION']) - gem 'facter', *location_for(ENV['FACTER_GEM_VERSION']) + gem 'facter', *location_for(ENV.fetch('FACTER_GEM_VERSION', nil)) + gem 'puppet', *location_for(ENV.fetch('PUPPET_GEM_VERSION', nil)) gem 'json_pure' gem 'sync' @@ -32,11 +33,8 @@ group :test do gem 'rake', require: false gem 'rspec', '~> 3.0', require: false - gem 'rubocop', '~> 1.64.0', require: false - gem 'rubocop-performance', '~> 1.16', require: false - gem 'rubocop-rspec', '~> 3.0', require: false gem 'simplecov', require: false gem 'simplecov-console', require: false - gem 'win32-taskscheduler', :platforms => [:mingw, :x64_mingw, :mswin] + gem 'win32-taskscheduler', platforms: %i[mingw x64_mingw mswin] end diff --git a/Rakefile b/Rakefile index a99a212a7..547bbb18f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rake' require 'rspec/core/rake_task' require 'rubocop/rake_task' @@ -5,25 +7,25 @@ require 'bundler/gem_tasks' require 'fileutils' require 'puppet' -task :default => :test -task :spec => :test +task default: :test +task spec: :test require 'rspec-puppet/tasks/release_test' fixtures_dir = File.expand_path(File.join(__FILE__, '..', 'spec', 'fixtures', 'modules')) fixtures = { 'augeas_core' => { - :url => 'https://github.com/puppetlabs/puppetlabs-augeas_core', - :requirement => Gem::Requirement.new('>= 6.0.0'), + url: 'https://github.com/puppetlabs/puppetlabs-augeas_core', + requirement: Gem::Requirement.new('>= 6.0.0'), }, - 'stdlib' => { - :url => 'https://github.com/puppetlabs/puppetlabs-stdlib', - :requirement => Gem::Requirement.new('>= 0'), - :ref => '4.2.0', + 'stdlib' => { + url: 'https://github.com/puppetlabs/puppetlabs-stdlib', + requirement: Gem::Requirement.new('>= 0'), + ref: '4.2.0', }, - 'registry' => { - :url => 'https://github.com/puppetlabs/puppetlabs-registry', - :requirement => Gem::Requirement.new('>= 0'), + 'registry' => { + url: 'https://github.com/puppetlabs/puppetlabs-registry', + requirement: Gem::Requirement.new('>= 0'), }, } @@ -49,13 +51,13 @@ namespace :test do next unless fixture[:requirement].satisfied_by?(puppet_version) system('git', 'clone', fixture[:url], name) - fail unless $?.success? + raise unless $?.success? + + next unless fixture.key?(:ref) - if fixture.key?(:ref) - Dir.chdir(name) do - system('git', 'checkout', fixture[:ref]) - fail unless $?.success? - end + Dir.chdir(name) do + system('git', 'checkout', fixture[:ref]) + raise unless $?.success? end end end @@ -65,32 +67,29 @@ namespace :test do Dir.chdir(fixtures_dir) do fixtures.each do |name, _| next unless File.directory?(name) + FileUtils.rm_r(name) end end end task :unit do - begin - Rake::Task['test:setup'].invoke - ENV['COVERAGE'] = 'local' - Rake::Task['test:spec_unit'].invoke - ensure - ENV.delete('COVERAGE') - Rake::Task['test:teardown'].invoke - end - end -end - -task :test do - begin Rake::Task['test:setup'].invoke - Rake::Task['test:spec'].invoke + ENV['COVERAGE'] = 'local' + Rake::Task['test:spec_unit'].invoke ensure + ENV.delete('COVERAGE') Rake::Task['test:teardown'].invoke end end +task :test do + Rake::Task['test:setup'].invoke + Rake::Task['test:spec'].invoke +ensure + Rake::Task['test:teardown'].invoke +end + RuboCop::RakeTask.new(:rubocop) do |task| task.options = %w[-D -S -E] end @@ -98,7 +97,7 @@ end namespace :spec do desc 'Run RSpec code examples with coverage collection' task :coverage do - ENV['COVERAGE'] = 'yes' - Rake::Task['test'].invoke + ENV['COVERAGE'] = 'yes' + Rake::Task['test'].invoke end end diff --git a/bin/rspec-puppet-init b/bin/rspec-puppet-init index ea2cfdeb8..5affc92f2 100755 --- a/bin/rspec-puppet-init +++ b/bin/rspec-puppet-init @@ -7,7 +7,7 @@ require 'rspec-puppet' require 'optparse' options = { - module_name: nil + module_name: nil, } OptionParser.new do |opts| diff --git a/lib/rspec-puppet/adapters.rb b/lib/rspec-puppet/adapters.rb index ba2283f30..86a8f0fe1 100644 --- a/lib/rspec-puppet/adapters.rb +++ b/lib/rspec-puppet/adapters.rb @@ -59,7 +59,7 @@ def setup_puppet(example_group) settings_hash = default_hash.merge(Hash[*settings]) if Gem.win_platform? settings_hash.each_with_object(settings_hash) do |(k, v), h| - h[k] = v == '/dev/null' ? 'c:/nul/' : v + h[k] = (v == '/dev/null') ? 'c:/nul/' : v end end @@ -101,9 +101,9 @@ def setup_puppet(example_group) { environments: loader, current_environment: env, - loaders: Puppet::Pops::Loaders.new(env) + loaders: Puppet::Pops::Loaders.new(env), }, - 'Setup rspec-puppet environments' + 'Setup rspec-puppet environments', ) end @@ -148,7 +148,7 @@ def settings_map %i[environmentpath environmentpath], %i[hiera_config hiera_config], %i[strict_variables strict_variables], - %i[vendormoduledir vendormoduledir] + %i[vendormoduledir vendormoduledir], ] end @@ -187,7 +187,7 @@ def set_facter_impl(impl) def self.get [ - ['7.11', Base] + ['7.11', Base], ].each do |(version, klass)| return klass.new if Puppet::Util::Package.versioncmp(Puppet.version, version) >= 0 end diff --git a/lib/rspec-puppet/consts.rb b/lib/rspec-puppet/consts.rb index b79615f4a..a80e71264 100644 --- a/lib/rspec-puppet/consts.rb +++ b/lib/rspec-puppet/consts.rb @@ -5,24 +5,24 @@ module RSpec::Puppet::Consts posix: { 'File::PATH_SEPARATOR' => ':', 'File::ALT_SEPARATOR' => nil, - 'Pathname::SEPARATOR_PAT' => /#{Regexp.quote('/')}/ + 'Pathname::SEPARATOR_PAT' => /#{Regexp.quote('/')}/, }, windows: { 'File::PATH_SEPARATOR' => ';', 'File::ALT_SEPARATOR' => '\\', - 'Pathname::SEPARATOR_PAT' => /[#{Regexp.quote('\\')}#{Regexp.quote('/')}]/ - } + 'Pathname::SEPARATOR_PAT' => /[#{Regexp.quote('\\')}#{Regexp.quote('/')}]/, + }, }.freeze FEATURES = { posix: { posix: true, - microsoft_windows: false + microsoft_windows: false, }, windows: { posix: false, - microsoft_windows: true - } + microsoft_windows: true, + }, }.freeze def self.stub_consts_for(platform) diff --git a/lib/rspec-puppet/coverage.rb b/lib/rspec-puppet/coverage.rb index 5297e67c0..c81110f0e 100644 --- a/lib/rspec-puppet/coverage.rb +++ b/lib/rspec-puppet/coverage.rb @@ -259,7 +259,7 @@ def results text = [ "Total resources: #{report[:total]}", "Touched resources: #{report[:touched]}", - "Resource coverage: #{report[:coverage]}%" + "Resource coverage: #{report[:coverage]}%", ] if (report[:untouched]).positive? @@ -341,7 +341,7 @@ def to_s def to_hash { - touched: touched? + touched: touched?, } end diff --git a/lib/rspec-puppet/example/function_example_group.rb b/lib/rspec-puppet/example/function_example_group.rb index 683612968..b304ddd15 100644 --- a/lib/rspec-puppet/example/function_example_group.rb +++ b/lib/rspec-puppet/example/function_example_group.rb @@ -148,7 +148,7 @@ def build_compiler node_options = { parameters: fact_values, - facts: node_facts + facts: node_facts, } stub_facts! fact_values @@ -157,9 +157,9 @@ def build_compiler Puppet.push_context( { - trusted_information: Puppet::Context::TrustedInformation.new('remote', node_name, trusted_values) + trusted_information: Puppet::Context::TrustedInformation.new('remote', node_name, trusted_values), }, - 'Context for spec trusted hash' + 'Context for spec trusted hash', ) compiler = Puppet::Parser::Compiler.new(node) @@ -168,9 +168,9 @@ def build_compiler Puppet.push_context( { loaders: loaders, - global_scope: compiler.context_overrides[:global_scope] + global_scope: compiler.context_overrides[:global_scope], }, - 'set globals' + 'set globals', ) compiler end diff --git a/lib/rspec-puppet/example/type_example_group.rb b/lib/rspec-puppet/example/type_example_group.rb index 35ab0e885..f9099a095 100644 --- a/lib/rspec-puppet/example/type_example_group.rb +++ b/lib/rspec-puppet/example/type_example_group.rb @@ -16,7 +16,7 @@ def subject # to pass all of the bits form the current scope # required to create it title, - my_params + my_params, ] end end diff --git a/lib/rspec-puppet/matchers/allow_value.rb b/lib/rspec-puppet/matchers/allow_value.rb index 473b02ac8..d0ac7fc40 100644 --- a/lib/rspec-puppet/matchers/allow_value.rb +++ b/lib/rspec-puppet/matchers/allow_value.rb @@ -28,7 +28,7 @@ def description end def failure_message - "expected that the type alias would #{description} but it raised the #{@error_msgs.length == 1 ? 'error' : 'errors'} #{@error_msgs.join(', ')}" + "expected that the type alias would #{description} but it raised the #{(@error_msgs.length == 1) ? 'error' : 'errors'} #{@error_msgs.join(', ')}" end def failure_message_when_negated diff --git a/lib/rspec-puppet/matchers/count_generic.rb b/lib/rspec-puppet/matchers/count_generic.rb index 8abf950ab..7a0e84289 100644 --- a/lib/rspec-puppet/matchers/count_generic.rb +++ b/lib/rspec-puppet/matchers/count_generic.rb @@ -6,7 +6,7 @@ class CountGeneric DEFAULT_RESOURCES = [ 'Class[main]', 'Class[Settings]', - 'Stage[main]' + 'Stage[main]', ].freeze attr_reader :resource_type @@ -46,10 +46,10 @@ def description desc << "contain exactly #{@expected_number}" if @type == 'class' - desc << (@expected_number == 1 ? 'class' : 'classes').to_s + desc << ((@expected_number == 1) ? 'class' : 'classes').to_s else desc << @resource_type.to_s unless @type == 'resource' - desc << (@expected_number == 1 ? 'resource' : 'resources').to_s + desc << ((@expected_number == 1) ? 'resource' : 'resources').to_s end desc.join(' ') diff --git a/lib/rspec-puppet/matchers/create_generic.rb b/lib/rspec-puppet/matchers/create_generic.rb index 19e4cc33b..d82fff850 100644 --- a/lib/rspec-puppet/matchers/create_generic.rb +++ b/lib/rspec-puppet/matchers/create_generic.rb @@ -207,12 +207,12 @@ def generate_param_list(list, type) output = [] list.each do |param, value| if value.nil? - output << "#{param} #{type == :not ? 'un' : ''}defined" + output << "#{param} #{(type == :not) ? 'un' : ''}defined" else - a = type == :not ? '!' : '=' + a = (type == :not) ? '!' : '=' b = value.is_a?(Regexp) ? '~' : '>' output << if (param.to_s == 'content') && value.is_a?(String) - "#{param} #{type == :not ? 'not ' : ''} supplied string" + "#{param} #{(type == :not) ? 'not ' : ''} supplied string" else "#{param} #{a}#{b} #{value.inspect}" end diff --git a/lib/rspec-puppet/monkey_patches.rb b/lib/rspec-puppet/monkey_patches.rb index 798fb257d..bcb6c8700 100644 --- a/lib/rspec-puppet/monkey_patches.rb +++ b/lib/rspec-puppet/monkey_patches.rb @@ -175,7 +175,7 @@ def windows? module_function :windows? def actual_platform - @actual_platform ||= !!File::ALT_SEPARATOR ? :windows : :posix + @actual_platform ||= (!!File::ALT_SEPARATOR) ? :windows : :posix end module_function :actual_platform @@ -394,7 +394,7 @@ module Kernel alias old_require require def require(path) return if ['puppet/util/windows', - 'win32/registry'].include?(path) && RSpec::Puppet.rspec_puppet_example? && Puppet::Util::Platform.pretend_windows? + 'win32/registry',].include?(path) && RSpec::Puppet.rspec_puppet_example? && Puppet::Util::Platform.pretend_windows? old_require(path) end diff --git a/lib/rspec-puppet/monkey_patches/windows/taskschedulerconstants.rb b/lib/rspec-puppet/monkey_patches/windows/taskschedulerconstants.rb index b2db06498..c8af533f0 100644 --- a/lib/rspec-puppet/monkey_patches/windows/taskschedulerconstants.rb +++ b/lib/rspec-puppet/monkey_patches/windows/taskschedulerconstants.rb @@ -5,7 +5,7 @@ module Puppet module Windows module TaskSchedulerConstants SYSTEM_USERS = ['NT AUTHORITY\SYSTEM', 'SYSTEM', 'NT AUTHORITY\LOCALSERVICE', 'NT AUTHORITY\NETWORKSERVICE', - 'BUILTIN\USERS', 'USERS'].freeze + 'BUILTIN\USERS', 'USERS',].freeze # Triggers @@ -221,7 +221,7 @@ module TaskSchedulerConstants CLSCTX_INPROC_SERVER = 0x1 CLSID_CTask = [0x148BD520, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8') CLSID_CTaskScheduler = [0x148BD52A, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, - 0x03].pack('LSSC8') + 0x03,].pack('LSSC8') IID_ITaskScheduler = [0x148BD527, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8') IID_ITask = [0x148BD524, 0xA2AB, 0x11CE, 0xB1, 0x1F, 0x00, 0xAA, 0x00, 0x53, 0x05, 0x03].pack('LSSC8') IID_IPersistFile = [0x0000010b, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46].pack('LSSC8') diff --git a/lib/rspec-puppet/setup.rb b/lib/rspec-puppet/setup.rb index f11985830..0e81258cd 100644 --- a/lib/rspec-puppet/setup.rb +++ b/lib/rspec-puppet/setup.rb @@ -55,7 +55,7 @@ def self.safe_setup_directories(module_name = nil, verbose = true) File.join('spec', 'hosts'), File.join('spec', 'fixtures'), File.join('spec', 'fixtures', 'manifests'), - File.join('spec', 'fixtures', 'modules') + File.join('spec', 'fixtures', 'modules'), ].each { |dir| safe_mkdir(dir, verbose) } target = File.join('spec', 'fixtures', 'modules', module_name) diff --git a/lib/rspec-puppet/support.rb b/lib/rspec-puppet/support.rb index 692bfe92a..831f70cf5 100644 --- a/lib/rspec-puppet/support.rb +++ b/lib/rspec-puppet/support.rb @@ -102,11 +102,11 @@ def load_catalogue(type, exported = false, manifest_opts = {}) trusted_external_data: trusted_external_data_hash, ignored_cache_params: { hiera_data_value: hiera_data_value, - rspec_config_values: rspec_config_values - } + rspec_config_values: rspec_config_values, + }, ) - test_module = type == :host ? nil : class_name.split('::').first + test_module = (type == :host) ? nil : class_name.split('::').first if type == :define RSpec::Puppet::Coverage.add_filter(class_name, title) else @@ -205,14 +205,14 @@ def post_cond def facts_hash(node) base_facts = { 'clientversion' => Puppet::PUPPETVERSION, - 'environment' => environment.to_s + 'environment' => environment.to_s, } node_facts = { 'hostname' => node.split('.').first, 'fqdn' => node, 'domain' => node.split('.', 2).last, - 'clientcert' => node + 'clientcert' => node, } # Puppet 6.9.0 started setting a `serverip6` server fact which is set @@ -227,7 +227,7 @@ def facts_hash(node) networking_facts = { 'hostname' => node_facts['hostname'], 'fqdn' => node_facts['fqdn'], - 'domain' => node_facts['domain'] + 'domain' => node_facts['domain'], } result_facts = if RSpec.configuration.default_facts.any? @@ -302,7 +302,7 @@ def server_facts_hash # And then add the server name and IP { 'servername' => 'fqdn', - 'serverip' => 'ipaddress' }.each do |var, fact| + 'serverip' => 'ipaddress', }.each do |var, fact| if (value = Puppet.runtime[:facter].value(fact)) server_facts[var] = value else @@ -382,7 +382,7 @@ def build_catalog_without_cache(nodename, facts_val, trusted_facts_val, hiera_co code: code, exported: exported, node_params: node_params, - trusted_external: {} + trusted_external: {}, }) end @@ -422,9 +422,9 @@ def build_catalog_without_cache_v2( trusted_info.push(trusted_external_data) Puppet.push_context( { - trusted_information: Puppet::Context::TrustedInformation.new(*trusted_info) + trusted_information: Puppet::Context::TrustedInformation.new(*trusted_info), }, - 'Context for spec trusted hash' + 'Context for spec trusted hash', ) node_obj.add_server_facts(server_facts_hash) diff --git a/lib/rspec-puppet/tasks/release_test.rb b/lib/rspec-puppet/tasks/release_test.rb index 65518651f..e5bae66c5 100644 --- a/lib/rspec-puppet/tasks/release_test.rb +++ b/lib/rspec-puppet/tasks/release_test.rb @@ -19,7 +19,7 @@ 'garethr/garethr-docker', 'sensu/sensu-puppet', 'jenkinsci/puppet-jenkins', - 'rnelson0/puppet-local_user' + 'rnelson0/puppet-local_user', ] Bundler.with_clean_env do diff --git a/rspec-puppet.gemspec b/rspec-puppet.gemspec index 0636b332d..32768eb2a 100644 --- a/rspec-puppet.gemspec +++ b/rspec-puppet.gemspec @@ -19,6 +19,7 @@ Gem::Specification.new do |s| s.files = Dir['CHANGELOG.md', 'LICENSE', 'README.md', 'lib/**/*', 'bin/**/*'] s.add_dependency 'rspec', '~> 3.0' + s.add_development_dependency 'voxpupuli-rubocop', '~> 2.8.0' s.authors = ['Tim Sharpe', 'Puppet, Inc.', 'Community Contributors'] s.email = ['tim@sharpe.id.au', 'modules-team@puppet.com'] diff --git a/spec/classes/array_spec.rb b/spec/classes/array_spec.rb index a8ec22b75..f5844fae0 100644 --- a/spec/classes/array_spec.rb +++ b/spec/classes/array_spec.rb @@ -10,7 +10,7 @@ it { expect(subject).to contain_structured_data__def('thing').with( - { 'data' => %w[foo bar baz quux] } + { 'data' => %w[foo bar baz quux] }, ) } end @@ -22,7 +22,7 @@ it { expect(subject).to contain_structured_data__def('thing').with( - { 'data' => ['first', 1, 'second', 2] } + { 'data' => ['first', 1, 'second', 2] }, ) } end @@ -34,7 +34,7 @@ 'second', %w[third fourth], 5, - 6 + 6, ] } end @@ -45,8 +45,8 @@ 'second', %w[third fourth], 5, - 6 - ] } + 6, + ] }, ) } end diff --git a/spec/classes/facts_spec.rb b/spec/classes/facts_spec.rb index b91f56175..0719e911e 100644 --- a/spec/classes/facts_spec.rb +++ b/spec/classes/facts_spec.rb @@ -12,8 +12,8 @@ let(:facts) do { os: { - 'family' => family - } + 'family' => family, + }, } end @@ -27,8 +27,8 @@ let(:facts) do { os: { - family: family - } + family: family, + }, } end @@ -43,8 +43,8 @@ let(:facts) do { oS: { - family: family - } + family: family, + }, } end @@ -58,8 +58,8 @@ let(:facts) do { 'os' => { - 'family' => family - } + 'family' => family, + }, } end @@ -74,8 +74,8 @@ let(:facts) do { 'oS' => { - 'family' => family - } + 'family' => family, + }, } end @@ -91,8 +91,8 @@ let(:facts) do { os: { - 'family' => family - } + 'family' => family, + }, } end @@ -106,8 +106,8 @@ let(:facts) do { os: { - family: family - } + family: family, + }, } end @@ -122,8 +122,8 @@ let(:facts) do { Os: { - family: family - } + family: family, + }, } end @@ -137,8 +137,8 @@ let(:facts) do { 'os' => { - 'family' => family - } + 'family' => family, + }, } end @@ -153,8 +153,8 @@ let(:facts) do { 'Os' => { - 'family' => family - } + 'family' => family, + }, } end @@ -170,8 +170,8 @@ let(:facts) do { 'custom_fact' => { - 'MixedCase' => 'value' - } + 'MixedCase' => 'value', + }, } end diff --git a/spec/classes/hash_spec.rb b/spec/classes/hash_spec.rb index 464e09ab5..72f6de962 100644 --- a/spec/classes/hash_spec.rb +++ b/spec/classes/hash_spec.rb @@ -10,7 +10,7 @@ it { expect(subject).to contain_structured_data__def('thing').with( - { 'data' => { 'foo' => 'bar', 'baz' => 'quux' } } + { 'data' => { 'foo' => 'bar', 'baz' => 'quux' } }, ) } end @@ -22,7 +22,7 @@ it { expect(subject).to contain_structured_data__def('thing').with( - { 'data' => { 1 => 'uno', 2 => 'dos' } } + { 'data' => { 1 => 'uno', 2 => 'dos' } }, ) } end @@ -34,7 +34,7 @@ it { expect(subject).to contain_structured_data__def('thing').with( - { 'data' => { 'first' => 1, 'second' => 2 } } + { 'data' => { 'first' => 1, 'second' => 2 } }, ) } end @@ -47,8 +47,8 @@ 'sec.ond' => 2, 'third' => { 'alpha' => 'a', - 'beta' => 'b' - } + 'beta' => 'b', + }, } } end @@ -59,9 +59,9 @@ 'sec.ond' => 2, 'third' => { 'alpha' => 'a', - 'beta' => 'b' - } - } } + 'beta' => 'b', + }, + } }, ) } end diff --git a/spec/classes/hiera_integration_spec.rb b/spec/classes/hiera_integration_spec.rb index 0b5eaf341..4dfd0e07b 100644 --- a/spec/classes/hiera_integration_spec.rb +++ b/spec/classes/hiera_integration_spec.rb @@ -42,7 +42,7 @@ context 'with absolute fixture hiera config path' do before do RSpec.configuration.fixture_hiera_configs = { - 'hiera_test' => File.join(__FILE__, '../../fixtures/modules/hiera_test/spec/module_hiera.yaml') + 'hiera_test' => File.join(__FILE__, '../../fixtures/modules/hiera_test/spec/module_hiera.yaml'), } end @@ -84,7 +84,7 @@ context 'with absolute fixture hiera config path' do before do RSpec.configuration.fixture_hiera_configs = { - 'hiera_test' => File.join(__FILE__, '../../fixtures/modules/hiera_test/spec/module_hiera.yaml') + 'hiera_test' => File.join(__FILE__, '../../fixtures/modules/hiera_test/spec/module_hiera.yaml'), } end diff --git a/spec/classes/map_reduce_spec.rb b/spec/classes/map_reduce_spec.rb index fd5f992ff..8dadf0e06 100644 --- a/spec/classes/map_reduce_spec.rb +++ b/spec/classes/map_reduce_spec.rb @@ -5,7 +5,7 @@ describe 'map_reduce' do let(:params) do { - values: [0, 1, 2] + values: [0, 1, 2], } end diff --git a/spec/classes/node_params_spec.rb b/spec/classes/node_params_spec.rb index 2814b774f..e99f21959 100644 --- a/spec/classes/node_params_spec.rb +++ b/spec/classes/node_params_spec.rb @@ -11,7 +11,7 @@ false => false, integer: 5, float: 4.4, - nil: nil + nil: nil, } let(:node_params) { fuzzed } diff --git a/spec/classes/server_facts_spec.rb b/spec/classes/server_facts_spec.rb index 66d73135b..25d3d3647 100644 --- a/spec/classes/server_facts_spec.rb +++ b/spec/classes/server_facts_spec.rb @@ -5,7 +5,7 @@ describe 'server_facts' do let(:facts) do { - ipaddress: '192.168.1.10' + ipaddress: '192.168.1.10', } end let(:node) { 'test123.test.com' } diff --git a/spec/classes/sysctl_common_spec.rb b/spec/classes/sysctl_common_spec.rb index 38cee16c7..47cbb2cbb 100644 --- a/spec/classes/sysctl_common_spec.rb +++ b/spec/classes/sysctl_common_spec.rb @@ -20,7 +20,7 @@ it 'passes if the parameters are contained in the resource' do expect(subject).to contain_exec('sysctl/reload').with( 'refreshonly' => 'true', - 'returns' => [0, 2] + 'returns' => [0, 2], ) end end @@ -73,7 +73,7 @@ expect(subject).to contain_exec('sysctl/reload').only_with( command: '/sbin/sysctl -p /etc/sysctl.conf', refreshonly: true, - returns: [0, 2] + returns: [0, 2], ) } @@ -88,7 +88,7 @@ expect do expect(subject).to contain_exec('sysctl/reload').only_with( command: '/sbin/sysctl -p /etc/sysctl.conf', - returns: [0, 2] + returns: [0, 2], ) end.to raise_error(RSpec::Expectations::ExpectationNotMetError) end @@ -98,7 +98,7 @@ expect(subject).to contain_exec('sysctl/reload').only_with( command: '/sbin/sysctl -p /etc/sysctl.conf', refreshonly: true, - creates: '/tmp/bla' + creates: '/tmp/bla', ) end.to raise_error(RSpec::Expectations::ExpectationNotMetError) end diff --git a/spec/classes/test_basic_spec.rb b/spec/classes/test_basic_spec.rb index 0a1bdd2cf..b09bdaf2f 100644 --- a/spec/classes/test_basic_spec.rb +++ b/spec/classes/test_basic_spec.rb @@ -12,8 +12,8 @@ { fqdn: 'notthis.test.com', networking: { - primary: 'eth0' - } + primary: 'eth0', + }, } end @@ -32,7 +32,7 @@ let(:node) { 'mycertname.test.com' } let(:facts) do { - fqdn: 'myhostname.test.com' + fqdn: 'myhostname.test.com', } end diff --git a/spec/classes/test_provider_suitability_spec.rb b/spec/classes/test_provider_suitability_spec.rb index fb88f8261..034aeb19f 100644 --- a/spec/classes/test_provider_suitability_spec.rb +++ b/spec/classes/test_provider_suitability_spec.rb @@ -7,18 +7,18 @@ { operatingsystem: 'Darwin', osfamily: 'Darwin', - kernel: 'Darwin' + kernel: 'Darwin', }, { operatingsystem: 'CentOS', osfamily: 'RedHat', - kernel: 'Linux' + kernel: 'Linux', }, { operatingsystem: 'Solaris', osfamily: 'Solaris', - kernel: 'SunOS' - } + kernel: 'SunOS', + }, ].each do |f| context "On #{f[:operatingsystem]}" do let(:facts) { f } diff --git a/spec/classes/test_user_spec.rb b/spec/classes/test_user_spec.rb index 7a3aa66e8..a3092792d 100644 --- a/spec/classes/test_user_spec.rb +++ b/spec/classes/test_user_spec.rb @@ -6,7 +6,7 @@ it { expect(subject).to contain_user('luke').only_with({ 'ensure' => 'present', - 'uid' => '501' + 'uid' => '501', }) } end diff --git a/spec/classes/trusted_facts_spec.rb b/spec/classes/trusted_facts_spec.rb index b10648210..382802929 100644 --- a/spec/classes/trusted_facts_spec.rb +++ b/spec/classes/trusted_facts_spec.rb @@ -30,7 +30,7 @@ context 'with extensions' do extensions = { :pp_uuid => 'ED803750-E3C7-44F5-BB08-41A04433FE2E', - '1.3.6.1.4.1.34380.1.2.1' => 'ssl-termination' + '1.3.6.1.4.1.34380.1.2.1' => 'ssl-termination', } let(:trusted_facts) { extensions } let(:node) { 'trusted.example.com' } diff --git a/spec/classes/type_mismatch_spec.rb b/spec/classes/type_mismatch_spec.rb index 2f15f370e..48e07116c 100644 --- a/spec/classes/type_mismatch_spec.rb +++ b/spec/classes/type_mismatch_spec.rb @@ -8,8 +8,8 @@ it do expect(subject).not_to contain_type_mismatch__hash('bug').with_hash( 'foo' => { - 'bar' => {} - } + 'bar' => {}, + }, ) end @@ -17,8 +17,8 @@ expect do expect(subject).not_to contain_type_mismatch__hash('bug').with_hash( 'foo' => { - 'bar' => {} - } + 'bar' => {}, + }, ) end.not_to raise_error end diff --git a/spec/classes/undef_spec.rb b/spec/classes/undef_spec.rb index d8f3cc8f0..4471d0067 100644 --- a/spec/classes/undef_spec.rb +++ b/spec/classes/undef_spec.rb @@ -20,7 +20,7 @@ expect(subject).to contain_class('undef_test').only_with( required_attribute: 'some_string', - defaults_to_undef: nil + defaults_to_undef: nil, ) end end @@ -41,7 +41,7 @@ expect(subject).to contain_class('undef_test').only_with( required_attribute: 'some_string', - defaults_to_undef: nil + defaults_to_undef: nil, ) end end @@ -64,7 +64,7 @@ expect(subject).to contain_class('undef_test').only_with( required_attribute: nil, - defaults_to_undef: nil + defaults_to_undef: nil, ) end end @@ -85,7 +85,7 @@ expect(subject).to contain_class('undef_test').only_with( required_attribute: nil, - defaults_to_undef: nil + defaults_to_undef: nil, ) end end diff --git a/spec/defines/sysctl_before_spec.rb b/spec/defines/sysctl_before_spec.rb index 0bfc5b29c..508550690 100644 --- a/spec/defines/sysctl_before_spec.rb +++ b/spec/defines/sysctl_before_spec.rb @@ -19,7 +19,7 @@ let(:title) { 'test define' } let(:pre_condition) do ['# we need sysctl common', - 'class {"sysctl::common":}'] + 'class {"sysctl::common":}',] end let(:params) { { value: 'title' } } diff --git a/spec/functions/trusted_facts_lookup_spec.rb b/spec/functions/trusted_facts_lookup_spec.rb index 60d285f2b..6a9f8da3e 100644 --- a/spec/functions/trusted_facts_lookup_spec.rb +++ b/spec/functions/trusted_facts_lookup_spec.rb @@ -17,7 +17,7 @@ let(:trusted_facts) do { 'extra1' => '1', - 'extra2' => '2' + 'extra2' => '2', } end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1ebc8271a..d91b52d10 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,7 +7,7 @@ SimpleCov.formatters = [ SimpleCov::Formatter::HTMLFormatter, - SimpleCov::Formatter::Console + SimpleCov::Formatter::Console, ] SimpleCov.start do diff --git a/spec/spec_helper_unit.rb b/spec/spec_helper_unit.rb index 88513884a..67dd53e38 100644 --- a/spec/spec_helper_unit.rb +++ b/spec/spec_helper_unit.rb @@ -7,7 +7,7 @@ SimpleCov.formatters = [ SimpleCov::Formatter::HTMLFormatter, - SimpleCov::Formatter::Console + SimpleCov::Formatter::Console, ] SimpleCov.start do diff --git a/spec/support_spec.rb b/spec/support_spec.rb index 94576da75..b6aa8cb6f 100644 --- a/spec/support_spec.rb +++ b/spec/support_spec.rb @@ -82,8 +82,8 @@ 'hostname' => 'fy73bdiqazmyj62', 'networking' => { 'hostname' => 'fy73bdiqazmyj62', - 'fqdn' => 'fy73bdiqazmyj62.delivery.puppetlabs.net' - } + 'fqdn' => 'fy73bdiqazmyj62.delivery.puppetlabs.net', + }, } end @@ -100,9 +100,9 @@ 'os' => { 'family' => family, 'version' => { - 'major' => '10' - } - } + 'major' => '10', + }, + }, }) end @@ -114,7 +114,7 @@ context 'with osfamily fact' do let(:build_hash) do super().merge({ - 'osfamily' => family + 'osfamily' => family, }) end diff --git a/spec/types/valid_provider_spec.rb b/spec/types/valid_provider_spec.rb index b5ccfac93..58dc8c170 100644 --- a/spec/types/valid_provider_spec.rb +++ b/spec/types/valid_provider_spec.rb @@ -13,7 +13,7 @@ { parameters: { baddies: %w[one two], goodies: %w[three four] }, properties: { baddies: %w[five fix], goodies: %w[seven eight] }, - features: { baddies: %w[nine ten], goodies: %w[eleven twelve] } + features: { baddies: %w[nine ten], goodies: %w[eleven twelve] }, }.each do |k, v| describe "#{k} checks" do [v[:baddies], v[:baddies].first].each do |baddies| @@ -22,7 +22,7 @@ expect(subject).to be_valid_type.send(:"with_#{k}", baddies) end.to raise_error( RSpec::Expectations::ExpectationNotMetError, - /Invalid #{k}: #{Array(baddies).join(',')}/ + /Invalid #{k}: #{Array(baddies).join(',')}/, ) end end @@ -50,7 +50,7 @@ expect(subject).to be_valid_type.with_provider(:non_matching) end.to raise_error( RSpec::Expectations::ExpectationNotMetError, - /Expected provider: non_matching does not match: default/ + /Expected provider: non_matching does not match: default/, ) end @@ -61,17 +61,17 @@ it 'fails with invalid parameters' do expect do expect(subject).to be_valid_type.with_set_attributes( - four: 'three' + four: 'three', ) end.to raise_error( Puppet::Error, - %r{Valid values match /\(one\|two\)/} + %r{Valid values match /\(one\|two\)/}, ) end it 'does not fail with valid parameters' do expect(subject).to be_valid_type.with_set_attributes( - four: 'one' + four: 'one', ) end end diff --git a/spec/unit/coverage_spec.rb b/spec/unit/coverage_spec.rb index 0ee8bb8a3..22c00ded2 100644 --- a/spec/unit/coverage_spec.rb +++ b/spec/unit/coverage_spec.rb @@ -48,7 +48,7 @@ [/escapism\\\\\Z/, /\ANotify\[.*escapism\\\\\]\z/], [/escapism\\\\$/, /\ANotify\[.*escapism\\\\\]\z/], [/escapism\\\\\$/, /\ANotify\[.*escapism\\\\\$.*\]\z/], - [/escapism\\\\\\\$/, /\ANotify\[.*escapism\\\\\\\$.*\]\z/] + [/escapism\\\\\\\$/, /\ANotify\[.*escapism\\\\\\\$.*\]\z/], ].each do |input, filter| it "maps #{input} to #{filter}" do subject.add_filter_regex('notify', input) diff --git a/spec/unit/facter_impl_spec.rb b/spec/unit/facter_impl_spec.rb index 11b4719a9..7f798f0fa 100644 --- a/spec/unit/facter_impl_spec.rb +++ b/spec/unit/facter_impl_spec.rb @@ -13,7 +13,7 @@ 'int_fact' => 3, 'true_fact' => true, 'false_fact' => false, - 'os' => { 'name' => 'my_os', 'release' => { 'major' => '42' } } + 'os' => { 'name' => 'my_os', 'release' => { 'major' => '42' } }, } end diff --git a/spec/unit/matchers/compile_spec.rb b/spec/unit/matchers/compile_spec.rb index dcf757ffc..0892d47f7 100644 --- a/spec/unit/matchers/compile_spec.rb +++ b/spec/unit/matchers/compile_spec.rb @@ -18,7 +18,7 @@ it { expect(subject).to have_attributes( - description: 'compile into a catalogue without dependency cycles' + description: 'compile into a catalogue without dependency cycles', ) } @@ -29,7 +29,7 @@ it { expect(subject).to have_attributes( - description: 'fail to compile and raise the error "example"' + description: 'fail to compile and raise the error "example"', ) } @@ -38,7 +38,7 @@ it { expect(subject).to have_attributes( - failure_message: a_string_starting_with('expected that the catalogue would fail to compile and raise the error "example"') + failure_message: a_string_starting_with('expected that the catalogue would fail to compile and raise the error "example"'), ) } end @@ -51,7 +51,7 @@ it { expect(subject).to have_attributes( - description: 'fail to compile and raise an error matching /example/' + description: 'fail to compile and raise an error matching /example/', ) } @@ -60,7 +60,7 @@ it { expect(subject).to have_attributes( - failure_message: a_string_starting_with('expected that the catalogue would fail to compile and raise an error matching /example/') + failure_message: a_string_starting_with('expected that the catalogue would fail to compile and raise an error matching /example/'), ) } end @@ -77,7 +77,7 @@ it { expect(subject).to have_attributes( - failure_message: a_string_matching(%r{\Aerror during compilation: Could not (retrieve dependency|find resource) 'File\[/tmp/missing\]'}) + failure_message: a_string_matching(%r{\Aerror during compilation: Could not (retrieve dependency|find resource) 'File\[/tmp/missing\]'}), ) } end @@ -93,7 +93,7 @@ it { expect(subject).to have_attributes( - failure_message: a_string_starting_with('error during compilation: ') + failure_message: a_string_starting_with('error during compilation: '), ) } end @@ -114,7 +114,7 @@ it { expect(subject).to have_attributes( - failure_message: a_string_starting_with('dependency cycles found: ') + failure_message: a_string_starting_with('dependency cycles found: '), ) } end @@ -130,7 +130,7 @@ it { expect(subject).to have_attributes( description: 'fail to compile and raise the error "example"', - failure_message: a_string_starting_with('dependency cycles found: ') + failure_message: a_string_starting_with('dependency cycles found: '), ) } end @@ -147,7 +147,7 @@ it { expect(subject).to have_attributes( description: 'fail to compile and raise an error matching /example/', - failure_message: a_string_starting_with('dependency cycles found: ') + failure_message: a_string_starting_with('dependency cycles found: '), ) } end @@ -165,7 +165,7 @@ it { expect(subject).to have_attributes( description: 'compile into a catalogue without dependency cycles', - failure_message: a_string_starting_with('error during compilation: ') + failure_message: a_string_starting_with('error during compilation: '), ) } end @@ -181,7 +181,7 @@ it { expect(subject).to have_attributes( - description: "fail to compile and raise the error \"#{expected_error}\"" + description: "fail to compile and raise the error \"#{expected_error}\"", ) } @@ -190,7 +190,7 @@ it { expect(subject).to have_attributes( - failure_message: a_string_starting_with('error during compilation: ') + failure_message: a_string_starting_with('error during compilation: '), ) } end @@ -203,7 +203,7 @@ it { expect(subject).to have_attributes( - description: 'fail to compile and raise an error matching /failure/' + description: 'fail to compile and raise an error matching /failure/', ) } @@ -212,7 +212,7 @@ it { expect(subject).to have_attributes( - failure_message: a_string_starting_with('error during compilation: ') + failure_message: a_string_starting_with('error during compilation: '), ) } end diff --git a/spec/unit/matchers/count_generic_spec.rb b/spec/unit/matchers/count_generic_spec.rb index 03cac7501..679ca7567 100644 --- a/spec/unit/matchers/count_generic_spec.rb +++ b/spec/unit/matchers/count_generic_spec.rb @@ -23,7 +23,7 @@ [ %w[Class main], %w[Class Settings], - %w[Stage main] + %w[Stage main], ] end @@ -147,7 +147,7 @@ let(:resources) do [ ['Class', 'test'], - ['Node', 'testhost.test.com'] + ['Node', 'testhost.test.com'], ] end @@ -160,7 +160,7 @@ super() + [ ['File', '/tmp/testfile'], ['Exec', 'some command'], - ['Service', 'a service'] + ['Service', 'a service'], ] end @@ -188,7 +188,7 @@ let(:resources) do [ %w[Class test], - %w[File testfile] + %w[File testfile], ] end diff --git a/spec/unit/monkey_patches_spec.rb b/spec/unit/monkey_patches_spec.rb index 4fdffd31c..5c9d2f5cd 100644 --- a/spec/unit/monkey_patches_spec.rb +++ b/spec/unit/monkey_patches_spec.rb @@ -136,7 +136,7 @@ Puppet::Module.new( 'escape', File.join(RSpec.configuration.module_path, 'escape'), - 'production' + 'production', ) end