Skip to content

Commit

Permalink
(RUBO) rubocop RSpec/MetadataStyle fix
Browse files Browse the repository at this point in the history
  • Loading branch information
david22swan committed Sep 11, 2023
1 parent df84a17 commit de82e24
Show file tree
Hide file tree
Showing 23 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion spec/acceptance/build_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk build', module_command: true do
describe 'pdk build', :module_command do
context 'when run inside of a module' do
include_context 'in a new module', 'build'

Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/convert_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
template_repo = 'https://github.com/puppetlabs/pdk-templates'
pdk_convert_base = "pdk convert --template-url=#{template_repo}"

describe 'pdk convert', module_command: true do
describe 'pdk convert', :module_command do
context 'with a fresh module' do
include_context 'in a new module', 'clean_module', template: template_repo

Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/new_class_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk new class', module_command: true do
describe 'pdk new class', :module_command do
shared_examples 'it creates a class' do |options|
describe file(options[:manifest]) do
it { is_expected.to be_file }
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/new_defined_type_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk new defined_type', module_command: true do
describe 'pdk new defined_type', :module_command do
shared_examples 'it creates a defined type' do |options|
describe file(options[:manifest]) do
it { is_expected.to be_file }
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/new_fact_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk new fact', module_command: true do
describe 'pdk new fact', :module_command do
shared_examples 'it creates a fact' do |_options|
context 'in a new module' do
include_context 'in a new module', 'new_fact'
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/new_function_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk new function', module_command: true do
describe 'pdk new function', :module_command do
shared_examples 'it creates a function' do |_options|
context 'in a new module' do
include_context 'in a new module', 'new_function'
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/new_provider_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk new provider', module_command: true do
describe 'pdk new provider', :module_command do
def update_module!
command('pdk update --force').exit_status
end
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/new_test_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk new test', module_command: true do
describe 'pdk new test', :module_command do
context 'in a new module' do
include_context 'in a new module', 'new_unit_test'

Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/new_transport_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk new transport', module_command: true do
describe 'pdk new transport', :module_command do
def update_module!
command('pdk update --force').exit_status
end
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/support/it_requires_running_in_a_module.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'fileutils'

RSpec.shared_examples('it requires running from inside a module', module_command: true) do
RSpec.shared_examples('it requires running from inside a module', :module_command) do
context 'when run outside of a module' do
before(:all) do
Dir.mkdir('empty_test_dir')
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/test_unit_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper_acceptance'
require 'fileutils'

describe 'pdk test unit', module_command: true do
describe 'pdk test unit', :module_command do
include_context 'with a fake TTY'

shared_context 'with spec file' do |filename, content|
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# key).
template_repo = 'https://github.com/puppetlabs/pdk-templates'

describe 'pdk update', module_command: true do
describe 'pdk update', :module_command do
context 'when run inside of a module' do
include_context 'in a new module', 'update', template: template_repo

Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/validate_all_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk validate', module_command: true do
describe 'pdk validate', :module_command do
include_context 'with a fake TTY'

context 'when run inside of a module' do
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/validate_metadata_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk validate metadata', module_command: true do
describe 'pdk validate metadata', :module_command do
let(:metadata_syntax_spinner) { /checking metadata syntax/i }
let(:module_style_spinner) { /checking module metadata style/i }
let(:task_style_spinner) { /checking task metadata style/i }
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/validate_puppet_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper_acceptance'
require 'fileutils'

describe 'pdk validate puppet', module_command: true do
describe 'pdk validate puppet', :module_command do
let(:epp_spinner_text) { /checking puppet EPP syntax/i }
let(:syntax_spinner_text) { /checking puppet manifest syntax/i }
let(:lint_spinner_text) { /checking puppet manifest style/i }
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/validate_ruby_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk validate ruby', module_command: true do
describe 'pdk validate ruby', :module_command do
include_context 'with a fake TTY'

context 'when run inside of a module' do
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/validate_tasks_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'pdk validate tasks', module_command: true do
describe 'pdk validate tasks', :module_command do
let(:task_style_spinner) { /checking task metadata style/i }
let(:task_name_spinner) { /checking task name/i }

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/pdk/config/json_schema_namespace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def load_and_ignore(namespace)

# Note that the JSON Schema Gem is too unreliable for testing right now.
# For the moment, all tests are skipped here.
describe PDK::Config::JSONSchemaNamespace, skip: true do
describe PDK::Config::JSONSchemaNamespace, :skip do
subject(:namespace) { described_class.new('spec', schema_file: temp_schema_file) }

let(:temp_schema_file) do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/pdk/config/json_schema_setting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Note that the JSON Schema Gem is too unreliable for testing right now.
# For the moment, all tests are skipped here.
describe PDK::Config::JSONSchemaSetting, skip: true do
describe PDK::Config::JSONSchemaSetting, :skip do
subject(:setting) { described_class.new('spec_setting', namespace, initial_value) }

let(:initial_value) { nil }
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/pdk/config/json_with_schema_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Note that the JSON Schema Gem is too unreliable for testing right now.
# For the moment, all tests are skipped here.
describe PDK::Config::JSONWithSchema, skip: true do
describe PDK::Config::JSONWithSchema, :skip do
subject(:json_config) { described_class.new(file: tempfile, schema_file: temp_schema_file) }

let(:tempfile) do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/pdk/config/yaml_with_schema_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Note that the JSON Schema Gem is too unreliable for testing right now.
# For the moment, all tests are skipped here.
describe PDK::Config::YAMLWithSchema, skip: true do
describe PDK::Config::YAMLWithSchema, :skip do
subject(:yaml_config) { described_class.new(file: tempfile, schema_file: temp_schema_file) }

let(:tempfile) do
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/pdk/module/convert_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def module_path(relative_path)
end
end

describe '.new', after_hook: true do
describe '.new', :after_hook do
let(:instance) { described_class.new(module_root, options) }
let(:options) { {} }
let(:update_manager) { instance_double(PDK::Module::UpdateManager, sync_changes!: true) }
Expand All @@ -109,7 +109,7 @@ def module_path(relative_path)
allow(PDK::Util::Bundler).to receive(:ensure_bundle!)
end

after(:each, after_hook: true) do
after(:each, :after_hook) do
instance.run
end

Expand Down
10 changes: 5 additions & 5 deletions spec/unit/pdk/util_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
end

shared_context 'with version file', version_file: true do
shared_context 'with version file', :version_file do
let(:version_file) { File.join('path', 'to', 'the', 'version', 'file') }

before do
Expand Down Expand Up @@ -154,7 +154,7 @@
it { is_expected.to be false }
end

context 'when a version file is present', version_file: true do
context 'when a version file is present', :version_file do
it { is_expected.to be true }
end
end
Expand Down Expand Up @@ -200,7 +200,7 @@
it { is_expected.to be true }
end

context 'when a version file is present', version_file: true do
context 'when a version file is present', :version_file do
it { is_expected.to be false }
end

Expand All @@ -224,7 +224,7 @@
end
end

context 'when the PDK was installed from a native package', version_file: true do
context 'when the PDK was installed from a native package', :version_file do
it 'returns the directory where the version file is located' do
expect(subject).to eq(File.dirname(version_file))
end
Expand All @@ -242,7 +242,7 @@
end
end

context 'when the PDK was installed from a native package', version_file: true do
context 'when the PDK was installed from a native package', :version_file do
it 'returns the path to the share/cache directory in the package' do
expect(subject).to eq(File.join(File.dirname(version_file), 'share', 'cache'))
end
Expand Down

0 comments on commit de82e24

Please sign in to comment.