source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/generate/task_spec.rb | Ruby | apache-2.0 | 231 | main | 4,081 | require 'spec_helper'
require 'pdk/generate/task'
describe PDK::Generate::Task do
subject(:generator) { instance }
let(:instance) { described_class.new(context, given_name, options) }
let(:context) { PDK::Context::Module.new(module_dir, module_dir) }
let(:module_name) { 'test_module' }
let(:module_dir) { '/... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/generate/module_spec.rb | Ruby | apache-2.0 | 231 | main | 29,500 | require 'spec_helper'
require 'tempfile'
require 'stringio'
require 'tty/prompt/test'
require 'pdk/generate/module'
require 'addressable'
shared_context 'allow summary to be printed to stdout' do
before do
allow($stdout).to receive(:puts).with(a_string_matching(/\A-+\Z/))
allow($stdout).to receive(:puts).wit... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/generate/provider_spec.rb | Ruby | apache-2.0 | 231 | main | 1,079 | require 'spec_helper'
require 'pdk/generate/provider'
describe PDK::Generate::Provider do
subject(:generator) { described_class.new(context, given_name, options) }
let(:context) { PDK::Context::Module.new(module_dir, module_dir) }
let(:module_dir) { '/tmp/test_module' }
let(:options) { {} }
let(:given_name)... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/generate/puppet_object_spec.rb | Ruby | apache-2.0 | 231 | main | 8,082 | require 'spec_helper'
require 'pdk/generate/puppet_object'
require 'addressable'
shared_context 'with puppet object module metadata' do
let(:module_metadata) { '{"name": "testuser-test_module"}' }
before do
allow(PDK::Util::Filesystem).to receive(:file?).with(metadata_path).and_return(true)
allow(PDK::Uti... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/generate/transport_spec.rb | Ruby | apache-2.0 | 231 | main | 1,112 | require 'spec_helper'
require 'pdk/generate/transport'
describe PDK::Generate::Transport do
subject(:generator) { described_class.new(context, given_name, options) }
let(:context) { PDK::Context::Module.new(module_dir, module_dir) }
let(:module_dir) { '/tmp/test_module' }
let(:options) { {} }
let(:given_nam... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/generate/defined_type_spec.rb | Ruby | apache-2.0 | 231 | main | 4,125 | require 'spec_helper'
require 'pdk/generate/defined_type'
describe PDK::Generate::DefinedType do
subject(:template_data) { generator.template_data }
let(:generator) { described_class.new(context, given_name, options) }
let(:context) { PDK::Context::Module.new(module_dir, module_dir) }
let(:module_name) { 'tes... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/generate/puppet_class_spec.rb | Ruby | apache-2.0 | 231 | main | 3,734 | require 'spec_helper'
require 'pdk/generate/puppet_class'
shared_examples 'it generates class template data' do
it 'includes the class name in the template data' do
expect(generator.template_data).to eq(name: expected_class_name)
end
end
describe PDK::Generate::PuppetClass do
subject(:generator) { described... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/template/template_dir_spec.rb | Ruby | apache-2.0 | 231 | main | 2,098 | require 'spec_helper'
require 'pdk/template/template_dir'
describe PDK::Template::TemplateDir do
subject(:template_dir) { described_class.new(template_uri, template_path, pdk_context, renderer) }
let(:template_uri) { PDK::Util::TemplateURI.new(PDK::Util::TemplateURI::PDK_TEMPLATE_URL) }
let(:template_path) { '/... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/template/fetcher_spec.rb | Ruby | apache-2.0 | 231 | main | 3,219 | require 'spec_helper'
require 'pdk/template/fetcher'
describe PDK::Template::Fetcher do
let(:template_uri) { PDK::Util::TemplateURI.new('/some/path') }
let(:fetcher_options) { {} }
describe '.instance' do
subject(:instance) { described_class.instance(template_uri, fetcher_options) }
context 'given a gi... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/template/renderer_spec.rb | Ruby | apache-2.0 | 231 | main | 1,701 | require 'spec_helper'
require 'pdk/template/renderer'
describe PDK::Template::Renderer do
let(:template_path) { '/some/path' }
let(:template_uri) { PDK::Util::TemplateURI.new(template_path) }
let(:pdk_context) { PDK::Context::None.new(nil) }
describe '.instance' do
subject(:instance) { described_class.ins... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/template/fetcher/local_spec.rb | Ruby | apache-2.0 | 231 | main | 874 | require 'spec_helper'
require 'pdk/template/fetcher/local'
describe PDK::Template::Fetcher::Local do
subject(:fetcher) { described_class.new(template_uri, pdk_context) }
let(:template_path) { '/some/path' }
let(:template_uri) { PDK::Util::TemplateURI.new(template_path) }
let(:pdk_context) { PDK::Context::None... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/template/fetcher/git_spec.rb | Ruby | apache-2.0 | 231 | main | 6,264 | require 'spec_helper'
require 'pdk/template/fetcher/git'
describe PDK::Template::Fetcher::Git do
subject(:fetcher) { described_class.new(template_uri, pdk_context) }
let(:uri_path) { '/some/path' }
let(:template_uri) { PDK::Util::TemplateURI.new(uri_path) }
let(:pdk_context) { PDK::Context::None.new(nil) }
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/template/renderer/v1_spec.rb | Ruby | apache-2.0 | 231 | main | 1,406 | require 'spec_helper'
require 'pdk/template/renderer/v1'
describe PDK::Template::Renderer::V1 do
let(:template_root) { '/some/path' }
let(:template_uri) { PDK::Util::TemplateURI.new(template_root) }
let(:pdk_context) { PDK::Context::None.new(nil) }
describe '.compatible?' do
subject(:compatible) { describ... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/template/renderer/v1/template_file_spec.rb | Ruby | apache-2.0 | 231 | main | 3,050 | require 'spec_helper'
require 'pdk/template/renderer/v1/template_file'
describe PDK::Template::Renderer::V1::TemplateFile do
subject(:template_file) { described_class.new(template_path, data) }
let(:data) { { configs: { 'test' => 'value' }, some: 'value' } }
describe '#config_for' do
subject { template_fil... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/template/renderer/v1/renderer_spec.rb | Ruby | apache-2.0 | 231 | main | 10,656 | require 'spec_helper'
require 'pdk/template/renderer/v1/renderer'
describe PDK::Template::Renderer::V1::Renderer do
subject(:renderer) { described_class.new(template_root, template_uri, pdk_context) }
let(:template_root) { '/some/path' }
let(:template_uri) { PDK::Util::TemplateURI.new(template_root) }
let(:pd... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/json_spec.rb | Ruby | apache-2.0 | 231 | main | 437 | require 'spec_helper'
require 'tempfile'
require 'pdk/config/json'
describe PDK::Config::JSON do
subject(:json_config) { described_class.new(file: tempfile) }
let(:tempfile) do
file = Tempfile.new('test')
file.path
end
it_behaves_like 'a file based namespace', "{\n \"foo\": \"bar\"\n}", 'foo' => 'ba... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/namespace_spec.rb | Ruby | apache-2.0 | 231 | main | 10,965 | require 'spec_helper'
require 'pdk/config/namespace'
def spec_simple_validator
{
proc: ->(value) { value.match(/(bar|baz)/) },
message: 'must be bar or baz'
}
end
describe PDK::Config::Namespace do
subject(:config) { described_class.new('config', **config_options) }
let(:config_options) { {} }
sha... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/yaml_with_schema_spec.rb | Ruby | apache-2.0 | 231 | main | 1,357 | require 'spec_helper'
require 'pdk/config/yaml_with_schema'
require 'tempfile'
# 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 do
subject(:yaml_config) { described_class.new(file: tempfile, schema_file:... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/schema_files_spec.rb | Ruby | apache-2.0 | 231 | main | 769 | require 'spec_helper'
require 'pdk/config'
require 'json-schema'
describe 'PDK::Config Schema Files' do
PDK::Util::Filesystem.glob(File.join(PDK::Config.json_schemas_path, '*_schema.json')).each do |schema_path|
describe File.basename(schema_path) do
# rubocop:disable PDK/FileOpen
subject(:schema) { ... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/json_schema_namespace_spec.rb | Ruby | apache-2.0 | 231 | main | 5,703 | require 'spec_helper'
require 'pdk/config/json_schema_namespace'
def load_and_ignore(namespace)
namespace.schema
rescue StandardError
# Do nothing
end
# 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, :... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/ini_file_setting_spec.rb | Ruby | apache-2.0 | 231 | main | 1,831 | require 'spec_helper'
require 'pdk/config/ini_file_setting'
describe PDK::Config::IniFileSetting do
subject(:setting) { described_class.new('spec_setting', namespace, initial_value) }
let(:initial_value) { nil }
let(:namespace) { PDK::Config::IniFile.new('spec') }
context 'when not in an Ini File Namespace'... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/json_schema_setting_spec.rb | Ruby | apache-2.0 | 231 | main | 3,474 | require 'spec_helper'
require 'pdk/config/json_schema_setting'
# 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 do
subject(:setting) { described_class.new('spec_setting', namespace, initial_value) }
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/yaml_spec.rb | Ruby | apache-2.0 | 231 | main | 466 | require 'spec_helper'
require 'pdk/config/yaml'
describe PDK::Config::YAML do
subject(:yaml_config) { described_class.new(file: tempfile) }
let(:tempfile) do
file = Tempfile.new('test')
file.write(data)
file.close
file.path
end
let(:data) { nil }
it_behaves_like 'a file based namespace', "-... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/ini_file_spec.rb | Ruby | apache-2.0 | 231 | main | 2,993 | require 'spec_helper'
require 'tempfile'
require 'pdk/config/ini_file'
require 'pdk/config/ini_file_setting'
RSpec.shared_examples 'an ini file based namespace reader' do |content, expected_settings|
before do
allow(PDK::Util::Filesystem).to receive(:mkdir_p)
end
describe '#parse_file' do
before do
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/json_with_schema_spec.rb | Ruby | apache-2.0 | 231 | main | 1,372 | require 'spec_helper'
require 'pdk/config/json_with_schema'
require 'tempfile'
# 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 do
subject(:json_config) { described_class.new(file: tempfile, schema_file:... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/config/setting_spec.rb | Ruby | apache-2.0 | 231 | main | 6,616 | require 'spec_helper'
require 'pdk/config/setting'
describe PDK::Config::Setting do
subject(:config_setting) { described_class.new(name, namespace) }
let(:namespace) { PDK::Config::Namespace.new('rspec') }
let(:name) { 'my_config_setting' }
describe '#qualified_name' do
it 'appends the setting name to it... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/validate_spec.rb | Ruby | apache-2.0 | 231 | main | 8,349 | require 'spec_helper'
require 'pdk/cli'
describe 'Running `pdk validate` in a module' do
subject { PDK::CLI.instance_variable_get(:@validate_cmd) }
let(:pretty_validator_names) { PDK::Validate.validator_names.join(', ') }
let(:report) { instance_double(PDK::Report).as_null_object }
let(:ruby_version) { PDK_VE... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/env_spec.rb | Ruby | apache-2.0 | 231 | main | 2,136 | require 'spec_helper'
require 'pdk/cli'
describe 'Running `pdk env`' do
let(:command_args) { ['env'] }
let(:command_result) { { exit_code: 0 } }
context 'when it calls env successfully' do
after do
expect do
PDK::CLI.run(command_args)
end.to exit_zero
end
before do
allow(P... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/util_spec.rb | Ruby | apache-2.0 | 231 | main | 15,992 | require 'spec_helper'
require 'pdk/cli/util'
describe PDK::CLI::Util do
before do
allow(PDK::Util::Env).to receive(:[]).and_call_original
end
describe '.ensure_in_module!' do
subject(:ensure_in_module) { described_class.ensure_in_module!(options) }
let(:error_msg) { a_string_matching(/no metadata\.... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/update_spec.rb | Ruby | apache-2.0 | 231 | main | 6,988 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI update' do
let(:help_text) { a_string_matching(/^USAGE\s+pdk update/m) }
let(:updater) do
instance_double(PDK::Module::Update, run: true, current_version:, new_version:, pinned_to_puppetlabs_template_tag?: pinned_to_tag, template_uri:)
end
let(:cur... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/errors_spec.rb | Ruby | apache-2.0 | 231 | main | 1,721 | require 'spec_helper'
require 'pdk/cli/errors'
describe PDK::CLI::FatalError do # rubocop:disable RSpec/MultipleDescribes
subject(:error) { described_class.new }
it 'has a default error message' do
expect(error.message).to match(/an unexpected error has occurred/i)
end
it 'has a default non-zero exit cod... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/release_spec.rb | Ruby | apache-2.0 | 231 | main | 3,407 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI release' do
context 'when not run from inside a module' do
include_context 'run outside module'
it 'exits with an error' do
expect(logger).to receive(:error).with(a_string_matching(/must be run from inside a valid module/))
expect { PDK:... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/console_spec.rb | Ruby | apache-2.0 | 231 | main | 8,649 | require 'spec_helper'
require 'pdk/cli'
describe 'pdk console', skip: 'Temporarily disabled (CONT-1154)' do
let(:console_cmd) { PDK::CLI.instance_variable_get(:@console_cmd) }
let(:module_path) { '/path/to/testmodule' }
let(:context) { PDK::Context::Module.new(module_path, module_path) }
before do
allow_a... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/bundle_spec.rb | Ruby | apache-2.0 | 231 | main | 1,725 | require 'spec_helper'
require 'pdk/cli'
describe 'Running `pdk bundle`' do
let(:command_args) { ['bundle'] }
let(:command_result) { { exit_code: 0 } }
context 'when it calls bundler successfully' do
before do
mock_command = instance_double(
PDK::CLI::Exec::InteractiveCommand,
:context=... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/test_spec.rb | Ruby | apache-2.0 | 231 | main | 352 | require 'spec_helper'
require 'pdk/cli'
describe 'Running `pdk test`' do
subject { PDK::CLI.instance_variable_get(:@test_cmd) }
it { is_expected.not_to be_nil }
context 'when no arguments or options are provided' do
it do
expect do
PDK::CLI.run(['test'])
end.to output(/^USAGE\s+pdk test... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/build_spec.rb | Ruby | apache-2.0 | 231 | main | 7,027 | require 'spec_helper'
require 'pdk/cli'
require 'puppet/modulebuilder'
describe 'PDK::CLI build' do
let(:help_text) { a_string_matching(/^USAGE\s+pdk build/m) }
let(:command_opts) { [] }
shared_context 'exits cleanly' do
after do
PDK::CLI.run(['build'] + command_opts)
end
end
context 'when no... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/convert_spec.rb | Ruby | apache-2.0 | 231 | main | 7,454 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI convert' do
include_context 'mock configuration'
let(:help_text) { a_string_matching(/^USAGE\s+pdk convert/m) }
let(:pdk_context) { PDK::Context::Module.new(module_root, module_root) }
let(:module_root) { '/path/to/test/module' }
before do
allo... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/new_spec.rb | Ruby | apache-2.0 | 231 | main | 312 | require 'spec_helper'
require 'pdk/cli'
describe 'Running `pdk new`' do
subject { PDK::CLI.instance_variable_get(:@new_cmd) }
context 'when no arguments or options are provided' do
it do
expect do
PDK::CLI.run(['new'])
end.to output(/^USAGE\s+pdk new/m).to_stdout
end
end
end |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/exec_spec.rb | Ruby | apache-2.0 | 231 | main | 1,367 | require 'spec_helper'
require 'pdk/cli/exec'
describe PDK::CLI::Exec do
describe '#try_vendored_bin' do
context 'when installed as gem' do
before { allow(PDK::Util).to receive(:package_install?).with(no_args).and_return(false) }
it 'returns the fallback' do
expect(described_class.try_vendore... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/util/option_normalizer_spec.rb | Ruby | apache-2.0 | 231 | main | 2,533 | require 'spec_helper'
require 'pdk/cli/util/option_normalizer'
describe PDK::CLI::Util::OptionNormalizer do
context 'when normalizing lists' do
it 'normalizes and return an array of strings when the list is comma separated' do
expect(described_class.comma_separated_list_to_array('a,b,c')).to eq(['a', 'b', ... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/util/interview_spec.rb | Ruby | apache-2.0 | 231 | main | 243 | require 'spec_helper'
require 'pdk/cli/util/interview'
describe 'Module interview' do
subject(:interview) { PDK::CLI::Util::Interview }
it 'initially has 0 questions' do
expect(interview.new({}, {}).num_questions).to eq(0)
end
end |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/util/command_redirector_spec.rb | Ruby | apache-2.0 | 231 | main | 747 | require 'spec_helper'
require 'pdk/cli/util/command_redirector'
describe PDK::CLI::Util::CommandRedirector do
subject(:command_redirector) do
described_class.new(prompt, {})
end
let(:prompt) { instance_double(TTY::Prompt) }
let(:command) { 'foo' }
it 'initially has no target command' do
expect(com... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/util/update_manager_printer_spec.rb | Ruby | apache-2.0 | 231 | main | 2,832 | require 'spec_helper'
require 'pdk/cli/util/update_manager_printer'
describe PDK::CLI::Util::UpdateManagerPrinter do
subject(:print_summary) { described_class.print_summary(update_manager, summary_options) }
let(:summary_options) { {} }
let(:updated_files) { {} }
let(:update_manager) do
manager = PDK::Mod... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/util/option_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 5,178 | require 'spec_helper'
require 'pdk/cli/util/option_validator'
shared_examples_for 'it accepts a lowercase word' do
it 'accepts a lowercase word' do |example|
expect(validator.send(example.metadata[:method], 'test')).to be true
end
end
shared_examples_for 'it accepts lowercase digits and underscores' do
it '... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/remove/config_spec.rb | Ruby | apache-2.0 | 231 | main | 10,385 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI::Remove::Config' do
describe '#run' do
subject(:run) { PDK::CLI::Remove::Config.run(cli_opts, cli_args) }
let(:force_opt) { nil }
let(:cli_opts) do
{
force: force_opt
}
end
let(:setting_name) { nil }
let(:setting_... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/set/config_spec.rb | Ruby | apache-2.0 | 231 | main | 9,016 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI::Set::Config' do
describe '#run' do
subject(:run) { PDK::CLI::Set::Config.run(cli_opts, cli_args) }
let(:type_opt) { nil }
let(:as_opt) { nil }
let(:force_opt) { nil }
let(:cli_opts) do
{
type: type_opt,
as: as_opt,... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/release/prep_spec.rb | Ruby | apache-2.0 | 231 | main | 1,981 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI release prep' do
let(:help_text) { a_string_matching(/^USAGE\s+pdk release prep/m) }
let(:cli_args) { ['release', 'prep'] }
context 'when not run from inside a module' do
include_context 'run outside module'
it 'exits with an error' do
ex... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/release/publish_spec.rb | Ruby | apache-2.0 | 231 | main | 3,594 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI release publish' do
let(:help_text) { a_string_matching(/^USAGE\s+pdk release publish/m) }
let(:base_cli_args) { ['release', 'publish'] }
context 'when not run from inside a module' do
include_context 'run outside module'
let(:cli_args) { base_... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/test/unit_spec.rb | Ruby | apache-2.0 | 231 | main | 8,114 | require 'spec_helper'
require 'pdk/cli'
describe '`pdk test unit`' do
subject(:test_unit_cmd) { PDK::CLI.instance_variable_get(:@test_unit_cmd) }
let(:ruby_version) { PDK_VERSION[:latest][:ruby] }
let(:puppet_version) { PDK_VERSION[:latest][:full] }
before do
allow(PDK::Util::RubyVersion).to receive(:use... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/new/task_spec.rb | Ruby | apache-2.0 | 231 | main | 2,658 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI new task' do
let(:help_text) { a_string_matching(/^USAGE\s+pdk new task/m) }
before do
allow(PDK::Util).to receive(:module_root).and_return(module_root)
# Stop printing out the result
allow(PDK::CLI::Util::UpdateManagerPrinter).to receive(:pri... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/new/test_spec.rb | Ruby | apache-2.0 | 231 | main | 3,764 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI new test' do
let(:help_text) { a_string_matching(/^USAGE\s+pdk new test/m) }
before do
# Stop printing out the result
allow(PDK::CLI::Util::UpdateManagerPrinter).to receive(:print_summary)
end
context 'when not run from inside a module' do
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/new/class_spec.rb | Ruby | apache-2.0 | 231 | main | 2,001 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI new class' do
let(:help_text) { a_string_matching(/^USAGE\s+pdk new class/m) }
before do
# Stop printing out the result
allow(PDK::CLI::Util::UpdateManagerPrinter).to receive(:print_summary)
end
context 'when not run from inside a module' do
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/new/module_spec.rb | Ruby | apache-2.0 | 231 | main | 4,920 | require 'spec_helper'
require 'pdk/cli'
describe 'Running `pdk new module`' do
subject { PDK::CLI.instance_variable_get(:@new_module_cmd) }
context 'when not passed a module name' do
context 'and run without --skip-interview' do
it 'continues to module interview' do
expect(PDK::Generate::Module)... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/new/defined_type_spec.rb | Ruby | apache-2.0 | 231 | main | 2,398 | require 'spec_helper'
require 'pdk/cli'
describe 'PDK::CLI new defined_type' do
let(:help_text) { a_string_matching(/^USAGE\s+pdk new defined_type/m) }
before do
allow(PDK::Util).to receive(:module_root).and_return(module_root)
# Stop printing out the result
allow(PDK::CLI::Util::UpdateManagerPrinter... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/exec/command_spec.rb | Ruby | apache-2.0 | 231 | main | 4,122 | require 'spec_helper'
require 'pdk/cli/exec/command'
describe PDK::CLI::Exec::Command do
subject(:command) { described_class.new('/bin/echo', 'foo') }
before do
allow(PDK::CLI::Util).to receive(:ci_environment?).and_return(false)
end
describe '.context=' do
context 'when setting to an expected value'... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/cli/exec/interactive_command_spec.rb | Ruby | apache-2.0 | 231 | main | 5,049 | require 'spec_helper'
require 'pdk/cli/exec/interactive_command'
describe PDK::CLI::Exec::InteractiveCommand do
subject(:command) { described_class.new('/bin/echo', 'foo') }
before do
allow(PDK::CLI::Util).to receive(:ci_environment?).and_return(false)
end
describe '.context=' do
context 'when settin... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/context/module_spec.rb | Ruby | apache-2.0 | 231 | main | 671 | require 'spec_helper'
require 'pdk/context'
describe PDK::Context::Module do
subject(:context) { described_class.new(module_root, nil) }
let(:module_root) { File.join(FIXTURES_DIR, 'puppet_module') }
it 'subclasses PDK::Context::AbstractContext' do
expect(context).is_a?(PDK::Context::AbstractContext)
end... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/context/control_repo_spec.rb | Ruby | apache-2.0 | 231 | main | 1,519 | require 'spec_helper'
require 'pdk/context'
describe PDK::Context::ControlRepo do
subject(:context) { described_class.new(repo_root, nil) }
let(:repo_root) { File.join(FIXTURES_DIR, 'control_repo') }
let(:expected_module_paths) { ['modules', 'site', '$basemodulepath'] }
let(:module_paths_in_fixture) { ['site'... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/context/none_spec.rb | Ruby | apache-2.0 | 231 | main | 328 | require 'spec_helper'
require 'pdk/context'
describe PDK::Context::None do
subject(:context) { described_class.new(nil) }
it 'subclasses PDK::Context::AbstractContext' do
expect(context).is_a?(PDK::Context::AbstractContext)
end
it 'has no parent context' do
expect(context.parent_context).to be_nil
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/test/unit_spec.rb | Ruby | apache-2.0 | 231 | main | 13,910 | require 'spec_helper'
require 'pdk/tests/unit'
describe PDK::Test::Unit do
it 'has an invoke method' do
expect(described_class.methods(false)).to include(:invoke)
end
describe '.rake_bin' do
subject { described_class.rake_bin }
before do
allow(PDK::Util).to receive(:module_root).and_return('/... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/invokable_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 18,497 | require 'spec_helper'
require 'pdk/validate/invokable_validator'
describe PDK::Validate::InvokableValidator do
include_context 'mock configuration'
class PublicInvokableValidator < PDK::Validate::InvokableValidator
# Expose protected/private methods for testing.
public :contextual_pattern
end
let(:va... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/internal_ruby_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 5,037 | require 'spec_helper'
require 'pdk/validate/internal_ruby_validator'
describe PDK::Validate::InternalRubyValidator do
let(:validator) { described_class.new(validator_context, validator_options) }
let(:validator_context) { nil }
let(:validator_options) { {} }
let(:targets) { [] }
let(:skipped_targets) { [] }
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/validator_group_spec.rb | Ruby | apache-2.0 | 231 | main | 5,244 | require 'spec_helper'
require 'pdk/validate/validator_group'
describe PDK::Validate::ValidatorGroup do
let(:validator_group) { described_class.new(validator_context, validator_options) }
let(:validator_context) { nil }
let(:validator_options) { {} }
describe '.spinner_text' do
it 'returns a String' do
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/external_command_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 9,553 | require 'spec_helper'
require 'pdk/validate/external_command_validator'
describe PDK::Validate::ExternalCommandValidator do
let(:validator) { described_class.new(validator_context, validator_options) }
let(:validator_context) { PDK::Context::Module.new(EMPTY_MODULE_ROOT, EMPTY_MODULE_ROOT) }
let(:validator_optio... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/validator_spec.rb | Ruby | apache-2.0 | 231 | main | 3,461 | require 'spec_helper'
require 'pdk/validate/validator'
describe PDK::Validate::Validator do
subject(:validator) { described_class.new(validator_context, validator_options) }
let(:validator_context) { nil }
let(:validator_options) { {} }
let(:mock_spinner) do
require 'pdk/cli/util/spinner'
instance_do... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/control_repo/control_repo_validator_group_spec.rb | Ruby | apache-2.0 | 231 | main | 613 | require 'spec_helper'
require 'pdk/validate/control_repo/control_repo_validator_group'
describe PDK::Validate::ControlRepo::ControlRepoValidatorGroup do
subject(:validator) { described_class.new(validator_context, validator_options) }
let(:validator_context) { nil }
let(:validator_options) { {} }
describe '.... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/control_repo/environment_conf_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 6,699 | require 'spec_helper'
require 'pdk/validate/control_repo/environment_conf_validator'
describe PDK::Validate::ControlRepo::EnvironmentConfValidator do
let(:validator) { described_class.new(validator_context, validator_options) }
let(:validator_context) { PDK::Context::ControlRepo.new(Dir.pwd, Dir.pwd) }
let(:vali... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/metadata/metadata_json_lint_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 5,541 | require 'spec_helper'
require 'pdk/validate/metadata/metadata_json_lint_validator'
describe PDK::Validate::Metadata::MetadataJSONLintValidator do
subject(:validator) { described_class.new }
it 'defines the base validator attributes' do
expect(validator).to have_attributes(
name: 'metadata-json-lint',
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/metadata/metadata_validator_group_spec.rb | Ruby | apache-2.0 | 231 | main | 377 | require 'spec_helper'
require 'pdk/validate/metadata/metadata_validator_group'
describe PDK::Validate::Metadata::MetadataValidatorGroup do
describe '.name' do
subject { described_class.new.name }
it { is_expected.to eq('metadata') }
end
describe '.validators' do
subject { described_class.new.valida... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/metadata/metadata_syntax_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 3,598 | require 'spec_helper'
require 'pdk/validate/metadata/metadata_syntax_validator'
describe PDK::Validate::Metadata::MetadataSyntaxValidator do
subject(:validator) { described_class.new(validator_context, targets: targets.map { |r| r[:name] }) }
let(:validator_context) { PDK::Context::Module.new(EMPTY_MODULE_ROOT, E... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/ruby/ruby_validator_group_spec.rb | Ruby | apache-2.0 | 231 | main | 357 | require 'spec_helper'
require 'pdk/validate/ruby/ruby_validator_group'
describe PDK::Validate::Ruby::RubyValidatorGroup do
describe '.name' do
subject { described_class.new.name }
it { is_expected.to eq('ruby') }
end
describe '.validators' do
subject { described_class.new.validators }
it { is_... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/ruby/ruby_rubocop_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 8,891 | require 'spec_helper'
require 'rubocop'
require 'ostruct'
require 'pdk/validate/ruby/ruby_rubocop_validator'
shared_examples_for 'it sets the common rubocop options' do
it 'sets the output format as JSON' do
expect(command_args.first(2)).to eq(['--format', 'json'])
end
it 'only sets 1 output format' do
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/puppet/puppet_lint_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 8,450 | require 'spec_helper'
require 'pdk/validate/puppet/puppet_lint_validator'
shared_examples_for 'it sets the common puppet-lint options' do
it 'sets the output format as JSON' do
expect(command_args.first).to eq('--json')
end
it 'sets the autoload layout plugin to ignore the top-most directory' do
expect(... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/puppet/puppet_epp_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 12,712 | require 'spec_helper'
require 'pdk/validate/puppet/puppet_epp_validator'
describe PDK::Validate::Puppet::PuppetEPPValidator do
subject(:validator) { described_class.new(validator_context, options) }
let(:validator_context) { nil }
let(:options) { {} }
let(:tmpdir) { File.join('/', 'tmp', 'puppet-epp-validate'... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/puppet/puppet_plan_syntax_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 3,401 | require 'spec_helper'
require 'pdk/validate/puppet/puppet_plan_syntax_validator'
describe PDK::Validate::Puppet::PuppetPlanSyntaxValidator do
subject(:validator) { described_class.new(validator_context, options) }
let(:validator_context) { nil }
let(:options) { {} }
let(:tmpdir) { File.join('/', 'tmp', 'puppe... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/puppet/puppet_syntax_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 12,941 | require 'spec_helper'
require 'pdk/validate/puppet/puppet_syntax_validator'
describe PDK::Validate::Puppet::PuppetSyntaxValidator do
subject(:validator) { described_class.new(validator_context, options) }
let(:validator_context) { nil }
let(:options) { {} }
let(:tmpdir) { File.join('/', 'tmp', 'puppet-parser-... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/puppet/puppet_validator_group_spec.rb | Ruby | apache-2.0 | 231 | main | 367 | require 'spec_helper'
require 'pdk/validate/puppet/puppet_validator_group'
describe PDK::Validate::Puppet::PuppetValidatorGroup do
describe '.name' do
subject { described_class.new.name }
it { is_expected.to eq('puppet') }
end
describe '.validators' do
subject { described_class.new.validators }
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/tasks/tasks_validator_group_spec.rb | Ruby | apache-2.0 | 231 | main | 362 | require 'spec_helper'
require 'pdk/validate/tasks/tasks_validator_group'
describe PDK::Validate::Tasks::TasksValidatorGroup do
describe '.name' do
subject { described_class.new.name }
it { is_expected.to eq('tasks') }
end
describe '.validators' do
subject { described_class.new.validators }
it ... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/tasks/tasks_metadata_lint_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 3,897 | require 'spec_helper'
require 'pdk/validate/tasks/tasks_name_validator'
describe PDK::Validate::Tasks::TasksMetadataLintValidator do
let(:schema) do
{
'title' => 'Puppet Task Metadata',
'description' => 'The metadata format for Puppet Tasks',
'type' => 'object',
'properties' => {
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/tasks/tasks_name_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 2,719 | require 'spec_helper'
require 'pdk/validate/tasks/tasks_name_validator'
describe PDK::Validate::Tasks::TasksNameValidator do
describe '.name' do
subject { described_class.new.name }
it { is_expected.to eq('task-name') }
end
describe '.spinner_text' do
subject(:spinner_text) { described_class.new.sp... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/yaml/yaml_syntax_validator_spec.rb | Ruby | apache-2.0 | 231 | main | 5,871 | require 'spec_helper'
require 'pdk/validate/yaml/yaml_syntax_validator'
describe PDK::Validate::YAML::YAMLSyntaxValidator do
let(:module_root) { File.join('path', 'to', 'test', 'module') }
before do
allow(PDK::Util).to receive(:module_root).and_return(module_root)
allow(PDK::Util::Filesystem).to receive(:... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/unit/pdk/validate/yaml/yaml_validator_group_spec.rb | Ruby | apache-2.0 | 231 | main | 357 | require 'spec_helper'
require 'pdk/validate/yaml/yaml_validator_group'
describe PDK::Validate::YAML::YAMLValidatorGroup do
describe '.name' do
subject { described_class.new.name }
it { is_expected.to eq('yaml') }
end
describe '.validators' do
subject { described_class.new.validators }
it { is_... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/update_spec.rb | Ruby | apache-2.0 | 231 | main | 2,381 | require 'spec_helper_acceptance'
# Force the modules generated in these specs to use the public template repo to
# avoid unnecessary changes in the metadata.json during convert (template-url
# key).
template_repo = 'https://github.com/puppetlabs/pdk-templates'
describe 'pdk update', :module_command do
context 'when... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/new_transport_spec.rb | Ruby | apache-2.0 | 231 | main | 3,693 | require 'spec_helper_acceptance'
describe 'pdk new transport', :module_command do
def update_module!
command('pdk update --force').exit_status
end
context 'when run inside of a module' do
include_context 'in a new module', 'new_transport'
describe command('pdk new transport test_transport') do
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/new_test_spec.rb | Ruby | apache-2.0 | 231 | main | 1,751 | require 'spec_helper_acceptance'
describe 'pdk new test', :module_command do
context 'in a new module' do
include_context 'in a new module', 'new_unit_test'
before(:all) do
File.open(File.join('manifests', 'init.pp'), 'w') do |fd|
fd.puts 'class new_unit_test {}'
end
File.open(Fil... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/validate_ruby_spec.rb | Ruby | apache-2.0 | 231 | main | 4,569 | require 'spec_helper_acceptance'
describe 'pdk validate ruby', :module_command do
include_context 'with a fake TTY'
context 'when run inside of a module' do
include_context 'in a new module', 'validate_ruby'
context 'with a style violation' do
spec_violation_rb = File.join('spec', 'violation.rb')
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/set_spec.rb | Ruby | apache-2.0 | 231 | main | 430 | require 'spec_helper_acceptance'
require 'fileutils'
describe 'pdk set' do
include_context 'with a fake TTY'
context 'when run outside of a module' do
describe command('pdk set') do
its(:exit_status) { is_expected.to eq 0 }
# Should show the command help
its(:stdout) { is_expected.to match(/... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/get_config_spec.rb | Ruby | apache-2.0 | 231 | main | 1,571 | require 'spec_helper_acceptance'
require 'fileutils'
describe 'pdk get config' do
include_context 'with a fake TTY'
context 'when run outside of a module' do
describe command('pdk get config') do
its(:exit_status) { is_expected.to eq 0 }
# This setting should appear in all pdk versions
its(:... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/validate_all_spec.rb | Ruby | apache-2.0 | 231 | main | 5,071 | require 'spec_helper_acceptance'
describe 'pdk validate', :module_command do
include_context 'with a fake TTY'
context 'when run inside of a module' do
include_context 'in a new module', 'validate_all'
before(:all) do
File.open(File.join('manifests', 'init.pp'), 'w') do |f|
f.puts <<~EOS
... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/convert_spec.rb | Ruby | apache-2.0 | 231 | main | 7,879 | require 'spec_helper_acceptance'
# Force the modules generated in these specs to use the public template repo to
# avoid unnecessary changes in the metadata.json during convert (template-url
# key).
template_repo = 'https://github.com/puppetlabs/pdk-templates'
pdk_convert_base = "pdk convert --template-url=#{template_... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/new_function_spec.rb | Ruby | apache-2.0 | 231 | main | 1,669 | require 'spec_helper_acceptance'
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'
context 'when creating the function' do
describe command('pdk new function -t v... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/version_changer_spec.rb | Ruby | apache-2.0 | 231 | main | 4,267 | require 'spec_helper_acceptance'
describe 'puppet version selection' do
context 'in a new module' do
include_context 'in a new module', 'version_select'
['PUPPET', 'FACTER', 'HIERA'].each do |gem|
context "when the legacy #{gem}_GEM_VERSION environment variable is used" do
if Gem.win_platform?... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/new_class_spec.rb | Ruby | apache-2.0 | 231 | main | 2,951 | require 'spec_helper_acceptance'
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 }
its(:content) { is_expected.to match(/class #{options[:name]} /) }
end
describe file(options[:spe... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/new_module_spec.rb | Ruby | apache-2.0 | 231 | main | 1,698 | require 'spec_helper_acceptance'
require 'pdk/version'
describe 'pdk new module' do
context 'when the --skip-interview option is used' do
after(:all) do
FileUtils.rm_rf('new_module')
end
describe command('pdk new module new_module --skip-interview') do
its(:exit_status) { is_expected.to eq 0... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/report_spec.rb | Ruby | apache-2.0 | 231 | main | 3,193 | require 'spec_helper_acceptance'
describe 'Saves report to a file' do
context 'with a fresh module' do
include_context 'in a new module', 'report_foo'
init_pp = File.join('manifests', 'init.pp')
before(:all) do
File.open(init_pp, 'w') do |f|
f.puts <<~EOS
class report
EO... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/new_provider_spec.rb | Ruby | apache-2.0 | 231 | main | 3,032 | require 'spec_helper_acceptance'
describe 'pdk new provider', :module_command do
def update_module!
command('pdk update --force').exit_status
end
context 'when run inside of a module' do
include_context 'in a new module', 'new_provider'
describe command('pdk new provider test_provider') do
it... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/validate_tasks_spec.rb | Ruby | apache-2.0 | 231 | main | 3,587 | require 'spec_helper_acceptance'
describe 'pdk validate tasks', :module_command do
let(:task_style_spinner) { /checking task metadata style/i }
let(:task_name_spinner) { /checking task name/i }
include_context 'with a fake TTY'
context 'when run inside of a module' do
include_context 'in a new module', '... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/test_unit_spec.rb | Ruby | apache-2.0 | 231 | main | 8,772 | require 'spec_helper_acceptance'
require 'fileutils'
describe 'pdk test unit', :module_command do
include_context 'with a fake TTY'
shared_context 'with spec file' do |filename, content|
around do |example|
path = File.join('spec', 'unit', filename)
FileUtils.mkdir_p(File.dirname(path))
File... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/new_defined_type_spec.rb | Ruby | apache-2.0 | 231 | main | 3,136 | require 'spec_helper_acceptance'
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 }
its(:content) { is_expected.to match(/define #{options[:name]}/) }
end
describe fil... |
github | puppetlabs/pdk | https://github.com/puppetlabs/pdk | spec/acceptance/get_spec.rb | Ruby | apache-2.0 | 231 | main | 430 | require 'spec_helper_acceptance'
require 'fileutils'
describe 'pdk get' do
include_context 'with a fake TTY'
context 'when run outside of a module' do
describe command('pdk get') do
its(:exit_status) { is_expected.to eq 0 }
# Should show the command help
its(:stdout) { is_expected.to match(/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.