repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/application/resource_spec.rb
spec/integration/application/resource_spec.rb
require 'spec_helper' require 'puppet_spec/files' describe "puppet resource", unless: Puppet::Util::Platform.jruby? do include PuppetSpec::Files let(:resource) { Puppet::Application[:resource] } context 'when given an invalid environment' do before { Puppet[:environment] = 'badenv' } it 'falls back to...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/provider/file/windows_spec.rb
spec/integration/provider/file/windows_spec.rb
require 'spec_helper' require 'puppet_spec/compiler' require 'puppet_spec/files' # For some reason the provider test will not filter out on windows when using the # :if => Puppet.features.microsoft_windows? method of filtering the tests. if Puppet.features.microsoft_windows? require 'puppet/util/windows' describe ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/l10n/compiler_spec.rb
spec/integration/l10n/compiler_spec.rb
require 'spec_helper' describe 'compiler localization' do include_context 'l10n', 'ja' let(:envdir) { File.join(my_fixture_dir, '..', 'envs') } let(:environments) do Puppet::Environments::Cached.new( Puppet::Environments::Directories.new(envdir, []) ) end let(:env) { Puppet::Node::Environment....
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/network/formats_spec.rb
spec/integration/network/formats_spec.rb
require 'spec_helper' require 'puppet/network/formats' class PsonIntTest attr_accessor :string def ==(other) other.class == self.class and string == other.string end def self.from_data_hash(data) new(data[0]) end def initialize(string) @string = string end def to_pson(*args) { ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/network/http_pool_spec.rb
spec/integration/network/http_pool_spec.rb
require 'spec_helper' require 'puppet_spec/https' require 'puppet_spec/files' require 'puppet/network/http_pool' describe Puppet::Network::HttpPool, unless: Puppet::Util::Platform.jruby? do include PuppetSpec::Files before :all do WebMock.disable! end after :all do WebMock.enable! end before :ea...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/network/http/api/indirected_routes_spec.rb
spec/integration/network/http/api/indirected_routes_spec.rb
require 'spec_helper' require 'puppet/network/http' require 'puppet/network/http/api/indirected_routes' require 'puppet/indirector_proxy' require 'puppet_spec/files' require 'puppet_spec/network' require 'puppet/util/json' require 'puppet/file_serving/content' require 'puppet/file_serving/metadata' describe Puppet::Ne...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/environments/settings_interpolation_spec.rb
spec/integration/environments/settings_interpolation_spec.rb
require 'pp' require 'spec_helper' require 'puppet_spec/settings' module SettingsInterpolationSpec describe "interpolating $environment" do include PuppetSpec::Settings let(:confdir) { Puppet[:confdir] } let(:cmdline_args) { ['--confdir', confdir, '--vardir', Puppet[:vardir], '--hiera_config', Puppet[:hiera_con...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/environments/default_manifest_spec.rb
spec/integration/environments/default_manifest_spec.rb
require 'spec_helper' module EnvironmentsDefaultManifestsSpec describe "default manifests" do context "puppet with default_manifest settings" do let(:confdir) { Puppet[:confdir] } let(:environmentpath) { File.expand_path("envdir", confdir) } context "relative default" do let(:testingdir) { File.j...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/environments/settings_spec.rb
spec/integration/environments/settings_spec.rb
require 'spec_helper' require 'puppet_spec/settings' describe "environment settings" do include PuppetSpec::Settings let(:confdir) { Puppet[:confdir] } let(:cmdline_args) { ['--confdir', confdir, '--vardir', Puppet[:vardir], '--hiera_config', Puppet[:hiera_config]] } let(:environmentpath) { File.expand_path("...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/environments/setting_hooks_spec.rb
spec/integration/environments/setting_hooks_spec.rb
require 'spec_helper' describe "setting hooks" do let(:confdir) { Puppet[:confdir] } let(:environmentpath) { File.expand_path("envdir", confdir) } describe "reproducing PUP-3500" do let(:productiondir) { File.join(environmentpath, "production") } before(:each) do FileUtils.mkdir_p(productiondir) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/agent/logging_spec.rb
spec/integration/agent/logging_spec.rb
require 'spec_helper' require 'puppet' require 'puppet/daemon' require 'puppet/application/agent' # The command line flags affecting #20900 and #20919: # # --onetime # --daemonize # --no-daemonize # --logdest # --verbose # --debug # (no flags) (-) # # d and nd are mutally exclusive # # Combinations without logdes...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/class_spec.rb
spec/integration/parser/class_spec.rb
require 'spec_helper' require 'puppet_spec/language' describe "Class expressions" do extend PuppetSpec::Language produces( "class hi { }" => '!defined(Class[hi])', "class hi { } include hi" => 'defined(Class[hi])', "include(hi) class hi...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/scope_spec.rb
spec/integration/parser/scope_spec.rb
require 'spec_helper' require 'puppet_spec/compiler' describe "Two step scoping for variables" do include PuppetSpec::Compiler def expect_the_message_to_be(message, node = Puppet::Node.new('the node')) catalog = compile_to_catalog(yield, node) expect(catalog.resource('Notify', 'something')[:message]).to eq...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/script_compiler_spec.rb
spec/integration/parser/script_compiler_spec.rb
require 'puppet' require 'spec_helper' require 'puppet_spec/compiler' require 'matchers/resource' require 'puppet/parser/script_compiler' describe 'the script compiler' do include PuppetSpec::Compiler include PuppetSpec::Files include Matchers::Resource before(:each) do Puppet[:tasks] = true end conte...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/dynamic_scoping_spec.rb
spec/integration/parser/dynamic_scoping_spec.rb
require 'spec_helper' require 'puppet/pops' require 'puppet/parser/parser_factory' require 'puppet_spec/compiler' require 'puppet_spec/pops' require 'puppet_spec/scope' require 'matchers/resource' # These tests are in a separate file since othr compiler related tests have # been dramatically changed between 3.x and 4....
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/undef_param_spec.rb
spec/integration/parser/undef_param_spec.rb
require 'spec_helper' require 'puppet_spec/compiler' describe "Parameter passing" do include PuppetSpec::Compiler before :each do # DataBinding will be consulted before falling back to a default value, # but we aren't testing that here allow(Puppet::DataBinding.indirection).to receive(:find) end ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/conditionals_spec.rb
spec/integration/parser/conditionals_spec.rb
require 'spec_helper' require 'puppet_spec/compiler' require 'matchers/resource' describe "Evaluation of Conditionals" do include PuppetSpec::Compiler include Matchers::Resource context "a catalog built with conditionals" do it "evaluates an if block correctly" do catalog = compile_to_catalog(<<-CODE)...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/collection_spec.rb
spec/integration/parser/collection_spec.rb
require 'spec_helper' require 'puppet_spec/compiler' describe 'collectors' do include PuppetSpec::Compiler def expect_the_message_to_be(expected_messages, code, node = Puppet::Node.new('the node')) catalog = compile_to_catalog(code, node) messages = catalog.resources.find_all { |resource| resource.type ==...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/parameter_defaults_spec.rb
spec/integration/parser/parameter_defaults_spec.rb
require 'spec_helper' require 'puppet_spec/language' ['Function', 'EPP'].each do |call_type| describe "#{call_type} parameter default expressions" do let! (:func_bodies) { [ '{}', '{ notice("\$a == ${a}") }', '{ notice("\$a == ${a}") notice("\$b == ${b}") }', '{ notice("\$a ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/pcore_resource_spec.rb
spec/integration/parser/pcore_resource_spec.rb
require 'spec_helper' require 'puppet_spec/files' require 'puppet_spec/compiler' require 'puppet/face' describe 'when pcore described resources types are in use' do include PuppetSpec::Files include PuppetSpec::Compiler let(:genface) { Puppet::Face[:generate, :current] } context "in an environment with two ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/resource_expressions_spec.rb
spec/integration/parser/resource_expressions_spec.rb
require 'spec_helper' require 'puppet_spec/language' describe "Puppet resource expressions" do extend PuppetSpec::Language produces( "$a = notify $b = example $c = { message => hello } @@Resource[$a] { $b: * => $c } realize(Resource[$a, $b]) " => "No...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/catalog_spec.rb
spec/integration/parser/catalog_spec.rb
require 'spec_helper' require 'matchers/include_in_order' require 'puppet_spec/compiler' require 'puppet/indirector/catalog/compiler' describe "A catalog" do include PuppetSpec::Compiler context "when compiled" do let(:env) { Puppet::Node::Environment.create(:testing, []) } let(:node) { Puppet::Node.new('...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/environment_spec.rb
spec/integration/parser/environment_spec.rb
require 'spec_helper' describe "A parser environment setting" do let(:confdir) { Puppet[:confdir] } let(:environmentpath) { File.expand_path("envdir", confdir) } let(:testingdir) { File.join(environmentpath, "testing") } before(:each) do FileUtils.mkdir_p(testingdir) end it "selects the given parser...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/compiler_spec.rb
spec/integration/parser/compiler_spec.rb
require 'spec_helper' require 'puppet_spec/compiler' require 'matchers/resource' # COPY OF UNIT TEST class CompilerTestResource attr_accessor :builtin, :virtual, :evaluated, :type, :title def initialize(type, title) @type = type @title = title end def [](attr) return nil if (attr == :stage || att...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
true
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/parser/node_spec.rb
spec/integration/parser/node_spec.rb
require 'spec_helper' require 'puppet_spec/compiler' require 'matchers/resource' describe 'node statements' do include PuppetSpec::Compiler include Matchers::Resource context 'nodes' do it 'selects a node where the name is just a number' do # Future parser doesn't allow a number in this position ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/integration/http/client_spec.rb
spec/integration/http/client_spec.rb
require 'spec_helper' require 'puppet_spec/https' require 'puppet_spec/files' describe Puppet::HTTP::Client, unless: Puppet::Util::Platform.jruby? do include PuppetSpec::Files include_context "https client" let(:wrong_hostname) { 'localhost' } let(:client) { Puppet::HTTP::Client.new } let(:ssl_provider) { P...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
# If you make changes to this file, regenerate the pcore resource type using # bundle exec puppet generate types --environmentpath spec/fixtures/integration/application/apply/environments -E spec Puppet::Type.newtype(:applytest) do newproperty(:message) do def sync Puppet.send(@resource[:loglevel], self.sho...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
Puppet::Type.type(:applytest).provide(:applytest) do end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
Facter.add(:agent_spec_role) do setcode { 'web' } end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
Puppet::Functions.create_function(:l10n) do dispatch :l10n_impl do end def l10n_impl _("IT'S HAPPY FUN TIME") end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/faulty_face/puppet/face/syntax.rb
spec/fixtures/faulty_face/puppet/face/syntax.rb
Puppet::Face.define(:syntax, '1.0.0') do action :foo do when_invoked do |whom| "hello, #{whom}" end # This 'end' is deliberately omitted, to induce a syntax error. # Please don't fix that, as it is used for testing. --daniel 2011-05-02 end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/awesome2/lib/puppet_x/awesome2/echo_scheme_handler.rb
spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/awesome2/lib/puppet_x/awesome2/echo_scheme_handler.rb
require 'puppet/plugins/binding_schemes' module PuppetX module Awesome2 # A binding scheme that echos its path # 'echo:/quick/brown/fox' becomes key '::quick::brown::fox' => 'echo: quick brown fox'. # (silly class for testing loading of extension) # class EchoSchemeHandler < Puppet::Plugins::Bind...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/awesome2/lib/puppet/bindings/awesome2/default.rb
spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/awesome2/lib/puppet/bindings/awesome2/default.rb
Puppet::Bindings.newbindings('awesome2::default') do |scope| bind.name('all your base').to('are belong to us') bind.name('env_meaning_of_life').to(puppet_string("$environment thinks it is 42", __FILE__)) bind { name 'awesome_x' to 'golden' } bind { name 'the_meaning_of_life' to 100 } bind ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/good/lib/puppet/bindings/good/default.rb
spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/good/lib/puppet/bindings/good/default.rb
Puppet::Bindings.newbindings('good::default') do |scope| bind { name 'the_meaning_of_life' to 300 } end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/bad/lib/puppet/bindings/bad/default.rb
spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/bad/lib/puppet/bindings/bad/default.rb
nil + nil + nil # broken on purpose, this file should never be loaded Puppet::Bindings.newbindings('bad::default') do |scope| nil + nil + nil # broken on purpose, this should never be evaluated end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/binder/bindings_composer/ok/lib/puppet/bindings/confdirtest.rb
spec/fixtures/unit/pops/binder/bindings_composer/ok/lib/puppet/bindings/confdirtest.rb
Puppet::Bindings.newbindings('confdirtest') do |scope| bind { name 'has_funny_hat' to 'the pope' } bind { name 'the_meaning_of_life' to 42 } end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/caller.rb
spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/caller.rb
Puppet::Functions.create_function(:'user::caller') do def caller() call_function('usee::callee', 'passed value') + " + I am user::caller()" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/ruby_calling_puppet.rb
spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/ruby_calling_puppet.rb
Puppet::Functions.create_function(:'user::ruby_calling_puppet') do def ruby_calling_puppet() call_function('usee::usee_puppet') end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/caller2.rb
spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/caller2.rb
Puppet::Functions.create_function(:'user::caller2') do def caller2() call_function('usee2::callee', 'passed value') + " + I am user::caller2()" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/ruby_calling_ruby.rb
spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/ruby_calling_ruby.rb
Puppet::Functions.create_function(:'user::ruby_calling_ruby') do def ruby_calling_ruby() call_function('usee::usee_ruby') end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/ruby_calling_puppet_init.rb
spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/lib/puppet/functions/user/ruby_calling_puppet_init.rb
Puppet::Functions.create_function(:'user::ruby_calling_puppet_init') do def ruby_calling_puppet_init() call_function('usee_puppet_init') end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/usee/lib/puppet/type/usee_type.rb
spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/usee/lib/puppet/type/usee_type.rb
Puppet::Type.newtype(:usee_type) do newparam(:name, :namevar => true) do desc 'An arbitrary name used as the identity of the resource.' end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/usee/lib/puppet/functions/usee/callee.rb
spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/usee/lib/puppet/functions/usee/callee.rb
Puppet::Functions.create_function(:'usee::callee') do def callee(value) "usee::callee() was told '#{value}'" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/usee/lib/puppet/functions/usee/usee_ruby.rb
spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/usee/lib/puppet/functions/usee/usee_ruby.rb
Puppet::Functions.create_function(:'usee::usee_ruby') do def usee_ruby() "I'm the function usee::usee_ruby()" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/usee2/lib/puppet/functions/usee2/callee.rb
spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/usee2/lib/puppet/functions/usee2/callee.rb
Puppet::Functions.create_function(:'usee2::callee') do def callee(value) "usee2::callee() was told '#{value}'" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller.rb
Puppet::Functions.create_function(:'user::caller') do def caller() call_function('callee', 'first') + ' - ' + call_function('callee', 'second') end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/callingpuppet.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/callingpuppet.rb
Puppet::Functions.create_function(:'user::callingpuppet') do def callingpuppet() call_function('user::puppetcalled', 'me') end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller_ws.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/user/lib/puppet/functions/user/caller_ws.rb
Puppet::Functions.create_function(:'user::caller_ws', Puppet::Functions::InternalFunction) do dispatch :caller_ws do scope_param param 'String', :value end def caller_ws(scope, value) scope = scope.compiler.newscope(scope) scope['passed_in_scope'] = value call_function_with_scope(scope, 'call...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load.rb
module Puppet::Parser::Functions newfunction(:bad_func_load, :type => :rvalue, :doc => <<-EOS A function using the 3x API EOS ) do |arguments| "the returned value" end def method_here_is_illegal() end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load2.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load2.rb
module Puppet::Parser::Functions x = newfunction(:bad_func_load2, :type => :rvalue, :doc => <<-EOS A function using the 3x API EOS ) do |arguments| "some return value" end end def illegal_method_here end x
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee_ws.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee_ws.rb
module Puppet::Parser::Functions newfunction(:callee_ws, :type => :rvalue, :doc => <<-EOS A function using the 3x API EOS ) do |arguments| "usee::callee_ws() got '#{self['passed_in_scope']}'" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load5.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load5.rb
x = module Puppet::Parser::Functions newfunction(:bad_func_load5, :type => :rvalue, :doc => <<-EOS A function using the 3x API EOS ) do |arguments| "some return value" end end def self.bad_func_load5_illegal_method end # Attempt to get around problem of not returning what newfunction returns x
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load4.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load4.rb
module Puppet::Parser::Functions newfunction(:bad_func_load4, :type => :rvalue, :doc => <<-EOS A function using the 3x API EOS ) do |arguments| def self.bad_func_load4_illegal_method "some return value from illegal method" end "some return value" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/callee.rb
module Puppet::Parser::Functions newfunction(:callee, :type => :rvalue, :doc => <<-EOS A function using the 3x API EOS ) do |arguments| "usee::callee() got '#{arguments[0]}'" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/good_func_load.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/good_func_load.rb
module Puppet::Parser::Functions newfunction(:good_func_load, :type => :rvalue, :doc => <<-EOS A function using the 3x API EOS ) do |arguments| # This is not illegal Float("3.14") end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load3.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/bad_func_load3.rb
module Puppet::Parser::Functions newfunction(:bad_func_load3, :type => :rvalue, :doc => <<-EOS A function using the 3x API EOS ) do |arguments| def bad_func_load3_illegal_method "some return value from illegal method" end "some return value" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/func_with_syntax_error.rb
spec/fixtures/unit/pops/loaders/loaders/mix_4x_and_3x_functions/usee/lib/puppet/parser/functions/func_with_syntax_error.rb
module Puppet::Parser::Functions newfunction(:func_with_syntax_error, :type => :rvalue, :doc => <<-EOS A function using the 3x API having a syntax error EOS ) do |arguments| # this syntax error is here on purpose! 1+ + + + end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb
spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb
Puppet::Functions.create_function(:rb_func_a) do def rb_func_a() "I am rb_func_a()" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb
spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb
Puppet::Functions.create_function(:'modulea::rb_func_a') do def rb_func_a() "I am modulea::rb_func_a()" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/lib/puppet/functions/moduleb/rb_func_b.rb
spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/lib/puppet/functions/moduleb/rb_func_b.rb
Puppet::Functions.create_function(:'moduleb::rb_func_b') do def rb_func_b() # Should be able to call modulea::rb_func_a() call_function('modulea::rb_func_a') + " + I am moduleb::rb_func_b()" end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/functions/abc/data.rb
spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/functions/abc/data.rb
Puppet::Functions.create_function(:'abc::data') do def data() { 'abc::def::test1' => 'module_test1', 'abc::def::test2' => 'module_test2', 'abc::def::test3' => 'module_test3', 'abc::def::ipl' => '%{lookup("abc::def::test2")}-ipl' } end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/data_providers/environments/production/lib/puppet/functions/environment/data.rb
spec/fixtures/unit/data_providers/environments/production/lib/puppet/functions/environment/data.rb
Puppet::Functions.create_function(:'environment::data') do def data() { 'abc::def::test1' => 'env_test1', 'abc::def::test2' => 'env_test2', 'xyz::def::test1' => 'env_test1', 'xyz::def::test2' => 'env_test2' } end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/bad_data/lib/puppet/functions/bad_data/data.rb
spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/bad_data/lib/puppet/functions/bad_data/data.rb
Puppet::Functions.create_function(:'bad_data::data') do def data() { 'b' => 'module_b', # Intentionally bad key (no module prefix) 'bad_data::c' => 'module_c' # Good key. Should be OK } end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/abc/lib/puppet/functions/abc/data.rb
spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/abc/lib/puppet/functions/abc/data.rb
Puppet::Functions.create_function(:'abc::data') do def data() { 'abc::b' => 'module_b', 'abc::c' => 'module_c', 'abc::e' => { 'k1' => 'module_e1', 'k2' => 'module_e2' }, 'abc::f' => { 'k1' => { 's1' => 'module_f11', 's3' => 'module_f13' }, 'k2' => { 's1' => 'module_f21', 's2' => 'module_f22' }}...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/bca/lib/puppet/functions/bca/data.rb
spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/bca/lib/puppet/functions/bca/data.rb
Puppet::Functions.create_function(:'bca::data') do def data() { 'bca::b' => 'module_bca_b', 'bca::c' => 'module_bca_c', 'bca::e' => { 'k1' => 'module_bca_e1', 'k2' => 'module_bca_e2' }, 'bca::f' => { 'k1' => { 's1' => 'module_bca_f11', 's3' => 'module_bca_f13' }, 'k2' => { 's1' => 'module_bca_f...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/meta/lib/puppet/functions/meta/data.rb
spec/fixtures/unit/functions/lookup_fixture/environments/production/modules/meta/lib/puppet/functions/meta/data.rb
Puppet::Functions.create_function(:'meta::data') do def data() { 'meta::b' => 'module_b', 'meta::c' => 'module_c', 'meta::e' => { 'k1' => 'module_e1', 'k2' => 'module_e2' }, 'meta::f' => { 'k1' => { 's1' => 'module_f11', 's3' => 'module_f13' }, 'k2' => { 's1' => 'module_f21', 's2' => 'module_f2...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/functions/lookup_fixture/environments/production/lib/puppet/functions/environment/data.rb
spec/fixtures/unit/functions/lookup_fixture/environments/production/lib/puppet/functions/environment/data.rb
Puppet::Functions.create_function(:'environment::data') do def data() { 'abc::a' => 'env_a', 'abc::c' => 'env_c', 'abc::d' => { 'k1' => 'env_d1', 'k2' => 'env_d2', 'k3' => 'env_d3' }, 'abc::e' => { 'k1' => 'env_e1', 'k3' => 'env_e3' }, 'bca::e' => { 'k1' => 'env_bca_e1', 'k3' => 'env_bca_e...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/functions/lookup/hiera/backend/other_backend.rb
spec/fixtures/unit/functions/lookup/hiera/backend/other_backend.rb
class Hiera::Backend::Other_backend def lookup(key, scope, order_override, resolution_type, context) value = Hiera::Config[:other][key.to_sym] throw :no_such_key if value.nil? value end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/functions/lookup/hiera/backend/custom_backend.rb
spec/fixtures/unit/functions/lookup/hiera/backend/custom_backend.rb
class Hiera::Backend::Custom_backend def lookup(key, scope, order_override, resolution_type, context) case key when 'hash_c' { 'hash_ca' => { 'cad' => 'value hash_c.hash_ca.cad (from global custom)' }} when 'hash' { 'array' => [ 'x5,x6' ] } when 'array' [ 'x5,x6' ] when 'datasour...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/unit/functions/hiera/hiera/backend/hieraspec_backend.rb
spec/fixtures/unit/functions/hiera/hiera/backend/hieraspec_backend.rb
class Hiera::Backend::Hieraspec_backend def initialize(cache = nil) Hiera.debug('Custom_backend starting') end def lookup(key, scope, order_override, resolution_type, context) case key when 'datasources' Hiera::Backend.datasources(scope, order_override) { |source| source } when 'resolution_...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/releases/jamtur01-apache/lib/puppet/type/a2mod.rb
spec/fixtures/releases/jamtur01-apache/lib/puppet/type/a2mod.rb
Puppet::Type.newtype(:a2mod) do @doc = "Manage Apache 2 modules" ensurable newparam(:name) do desc "The name of the module to be managed" isnamevar end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/fixtures/releases/jamtur01-apache/lib/puppet/provider/a2mod/debian.rb
spec/fixtures/releases/jamtur01-apache/lib/puppet/provider/a2mod/debian.rb
Puppet::Type.type(:a2mod).provide(:debian) do desc "Manage Apache 2 modules on Debian-like OSes (e.g. Ubuntu)" commands :encmd => "a2enmod" commands :discmd => "a2dismod" defaultfor 'os.name' => [:debian, :ubuntu] def create encmd resource[:name] end def destroy discmd re...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/shared_examples/rhel_package_provider.rb
spec/shared_examples/rhel_package_provider.rb
shared_examples "RHEL package provider" do |provider_class, provider_name| describe provider_name do let(:name) { 'mypackage' } let(:resource) do Puppet::Type.type(:package).new( :name => name, :ensure => :installed, :provider => provider_name ) end let(:provi...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/shared_contexts/provider.rb
spec/shared_contexts/provider.rb
require 'spec_helper' RSpec.shared_context('provider specificity') do around do |example| old_defaults = described_class.instance_variable_get(:@defaults) old_notdefaults = described_class.instance_variable_get(:@notdefaults) begin described_class.instance_variable_set(:@defaults, []) describ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/shared_contexts/l10n.rb
spec/shared_contexts/l10n.rb
require 'spec_helper' RSpec.shared_context('l10n') do |locale| before :all do @old_locale = Locale.current Locale.current = locale @old_gettext_disabled = Puppet::GettextConfig.instance_variable_get(:@gettext_disabled) Puppet::GettextConfig.instance_variable_set(:@gettext_disabled, false) Puppet...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/shared_contexts/checksum.rb
spec/shared_contexts/checksum.rb
# Shared contexts for testing against all supported checksum types. # # These helpers define nested rspec example groups to test code against all our # supported checksum types. Example groups that need to be run against all # types should use the `with_checksum_types` helper which will # create a new example group for...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/shared_contexts/digests.rb
spec/shared_contexts/digests.rb
# Shared contexts for testing against all supported digest algorithms. # # These helpers define nested rspec example groups to test code against all our # supported digest algorithms. Example groups that need to be run against all # algorithms should use the `with_digest_algorithms` helper which will # create a new exa...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/shared_contexts/types_setup.rb
spec/shared_contexts/types_setup.rb
shared_context 'types_setup' do # Do not include the special type Unit in this list # Do not include the type Variant in this list as it needs to be parameterized to be meaningful def self.all_types [ Puppet::Pops::Types::PAnyType, Puppet::Pops::Types::PUndefType, Puppet::Pops::Types::PNotUndefTy...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/shared_contexts/https.rb
spec/shared_contexts/https.rb
require 'spec_helper' RSpec.shared_context('https client') do before :all do WebMock.disable! end after :all do WebMock.enable! end before :each do # make sure we don't take too long Puppet[:http_connect_timeout] = '5s' Puppet[:server] = '127.0.0.1' Puppet[:certname] = '127.0.0.1' ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/matchers/match_tokens2.rb
spec/lib/matchers/match_tokens2.rb
# Matches tokens produced by lexer # The given exepected is one or more entries where an entry is one of # - a token symbol # - an Array with a token symbol and the text value # - an Array with a token symbol and a Hash specifying all attributes of the token # - nil (ignore) # RSpec::Matchers.define :match_tokens2 do |...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/matchers/resource.rb
spec/lib/matchers/resource.rb
module Matchers; module Resource extend RSpec::Matchers::DSL matcher :have_resource do |expected_resource| def resource_match(expected_resource, actual_resource) matched = true failures = [] if actual_resource.ref != expected_resource matched = false failures << "expected #{e...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/matchers/relationship_graph_matchers.rb
spec/lib/matchers/relationship_graph_matchers.rb
module RelationshipGraphMatchers class EnforceOrderWithEdge def initialize(before, after) @before = before @after = after end def matches?(actual_graph) @actual_graph = actual_graph @reverse_edge = actual_graph.edge?( vertex_called(actual_graph, @after), verte...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/matchers/json.rb
spec/lib/matchers/json.rb
module JSONMatchers class SetJsonAttribute def initialize(attributes) @attributes = attributes end def format @format ||= Puppet::Network::FormatHandler.format('json') end def json(instance) Puppet::Util::Json.load(instance.to_json) end def attr_value(attrs, instance) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/matchers/containment_matchers.rb
spec/lib/matchers/containment_matchers.rb
module ContainmentMatchers class ContainClass def initialize(containee) @containee = containee end def in(container) @container = container self end def matches?(catalog) @catalog = catalog raise ArgumentError, "You must set the container using #in" unless @contain...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/matchers/include_in_order_spec.rb
spec/lib/matchers/include_in_order_spec.rb
require 'spec_helper' require 'matchers/include_in_order' describe "Matching whether elements are included in order" do context "an empty array" do it "is included in an empty array" do expect([]).to include_in_order() end it "is included in a non-empty array" do expect([1]).to include_in_or...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/matchers/include_in_order.rb
spec/lib/matchers/include_in_order.rb
RSpec::Matchers.define :include_in_order do |*expected| match do |actual| elements = expected.dup actual.each do |elt| if elt == elements.first elements.shift end end elements.empty? end def failure_message "expected #{@actual.inspect} to include#{expected} in order" en...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/language.rb
spec/lib/puppet_spec/language.rb
require 'puppet_spec/compiler' require 'matchers/resource' module PuppetSpec::Language extend RSpec::Matchers::DSL def produces(expectations) calledFrom = caller expectations.each do |manifest, resources| it "evaluates #{manifest} to produce #{resources}" do begin case resources ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/fixtures.rb
spec/lib/puppet_spec/fixtures.rb
module PuppetSpec::Fixtures def fixtures(*rest) File.join(PuppetSpec::FIXTURE_DIR, *rest) end def my_fixture_dir callers = caller while line = callers.shift do next unless found = line.match(%r{/spec/(.*)_spec\.rb:}) return fixtures(found[1]) end fail "sorry, I couldn't work out yo...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/files.rb
spec/lib/puppet_spec/files.rb
require 'fileutils' require 'tempfile' require 'tmpdir' require 'pathname' # A support module for testing files. module PuppetSpec::Files def self.cleanup $global_tempfiles ||= [] while path = $global_tempfiles.pop do begin FileUtils.rm_rf path, secure: true rescue Errno::ENOENT #...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/matchers.rb
spec/lib/puppet_spec/matchers.rb
require 'stringio' ######################################################################## # Custom matchers... RSpec::Matchers.define :have_matching_element do |expected| match do |actual| actual.any? { |item| item =~ expected } end end RSpec::Matchers.define :have_matching_log do |expected| match do |act...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/compiler.rb
spec/lib/puppet_spec/compiler.rb
module PuppetSpec::Compiler module_function def compile_to_catalog(string, node = Puppet::Node.new('test')) Puppet[:code] = string # see lib/puppet/indirector/catalog/compiler.rb#filter Puppet::Parser::Compiler.compile(node).filter { |r| r.virtual? } end # Does not removed virtual resources in com...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/network.rb
spec/lib/puppet_spec/network.rb
require 'spec_helper' require 'puppet/network/http' require 'puppet/network/http/api/indirected_routes' require 'puppet/indirector_testing' module PuppetSpec::Network def not_found_error Puppet::Network::HTTP::Error::HTTPNotFoundError end def not_acceptable_error Puppet::Network::HTTP::Error::HTTPNotAc...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/ssl.rb
spec/lib/puppet_spec/ssl.rb
require 'openssl' module PuppetSpec module SSL PRIVATE_KEY_LENGTH = 2048 FIVE_YEARS = 5 * 365 * 24 * 60 * 60 CA_EXTENSIONS = [ ["basicConstraints", "CA:TRUE", true], ["keyUsage", "keyCertSign, cRLSign", true], ["subjectKeyIdentifier", "hash", false], ["authorityKeyIdentifier", "k...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/verbose.rb
spec/lib/puppet_spec/verbose.rb
# Support code for running stuff with warnings disabled or enabled module Kernel def with_verbose_disabled verbose, $VERBOSE = $VERBOSE, nil begin yield ensure $VERBOSE = verbose end end def with_verbose_enabled verbose, $VERBOSE = $VERBOSE, true begin yield ensure ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/settings.rb
spec/lib/puppet_spec/settings.rb
module PuppetSpec::Settings # It would probably be preferable to refactor defaults.rb such that the real definitions of # these settings were available as a variable, which was then accessible for use during tests. # However, I'm not doing that yet because I don't want to introduce any additional moving parts ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/scope.rb
spec/lib/puppet_spec/scope.rb
module PuppetSpec::Scope # Initialize a new scope suitable for testing. # def create_test_scope_for_node(node_name) node = Puppet::Node.new(node_name) compiler = Puppet::Parser::Compiler.new(node) scope = Puppet::Parser::Scope.new(compiler) scope.source = Puppet::Resource::Type.new(:node, node_nam...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/handler.rb
spec/lib/puppet_spec/handler.rb
require 'puppet/network/http/handler' class PuppetSpec::Handler include Puppet::Network::HTTP::Handler def initialize(* routes) register(routes) end def set_content_type(response, format) response[:content_type_header] = format end def set_response(response, body, status = 200) response[:bod...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/puppetserver.rb
spec/lib/puppet_spec/puppetserver.rb
require 'spec_helper' require 'webrick' require "webrick/ssl" class PuppetSpec::Puppetserver include PuppetSpec::Fixtures include PuppetSpec::Files attr_reader :ca_cert, :ca_crl, :server_cert, :server_key class NodeServlet < WEBrick::HTTPServlet::AbstractServlet def do_GET request, response node = ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/unindent.rb
spec/lib/puppet_spec/unindent.rb
class String def unindent(left_padding = '') gsub(/^#{scan(/^\s*/).min_by{ |l| l.length }}/, left_padding) end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/lib/puppet_spec/https.rb
spec/lib/puppet_spec/https.rb
require 'spec_helper' require 'webrick' class PuppetSpec::HTTPSServer include PuppetSpec::Fixtures attr_reader :ca_cert, :ca_crl, :server_cert, :server_key def initialize(ca_cert: nil, ca_crl: nil, server_key: nil, server_cert: nil) @ca_cert = ca_cert || cert_fixture('ca.pem') @ca_crl = ca_crl || crl_f...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false