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/unit/util/lockfile_spec.rb
spec/unit/util/lockfile_spec.rb
require 'spec_helper' require 'puppet/util/lockfile' module LockfileSpecHelper def self.run_in_forks(count, &blk) forks = {} results = [] count.times do |i| forks[i] = {} forks[i][:read], forks[i][:write] = IO.pipe forks[i][:pid] = fork do forks[i][:read].close res = y...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/filetype_spec.rb
spec/unit/util/filetype_spec.rb
require 'spec_helper' require 'puppet/util/filetype' # XXX Import all of the tests into this file. describe Puppet::Util::FileType do describe "the flat filetype" do let(:path) { '/my/file' } let(:type) { Puppet::Util::FileType.filetype(:flat) } let(:file) { type.new(path) } it "should exist" do ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/json_spec.rb
spec/unit/util/json_spec.rb
# coding: utf-8 require 'spec_helper' require 'puppet/util/json' describe Puppet::Util::Json do include PuppetSpec::Files shared_examples_for 'json file loader' do |load_method| it 'reads a JSON file from disk' do file_path = file_containing('input', JSON.dump({ "my" => "data" })) expect(load_met...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/checksums_spec.rb
spec/unit/util/checksums_spec.rb
require 'spec_helper' require 'puppet/util/checksums' describe Puppet::Util::Checksums do include PuppetSpec::Files before do @summer = Puppet::Util::Checksums end content_sums = [:md5, :md5lite, :sha1, :sha1lite, :sha256, :sha256lite, :sha512, :sha384, :sha224] file_only = [:ctime, :mtime, :none] ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/watched_file_spec.rb
spec/unit/util/watched_file_spec.rb
require 'spec_helper' require 'puppet/util/watched_file' require 'puppet/util/watcher' describe Puppet::Util::WatchedFile do let(:an_absurdly_long_timeout) { Puppet::Util::Watcher::Timer.new(100000) } let(:an_immediate_timeout) { Puppet::Util::Watcher::Timer.new(0) } it "acts like a string so that it can be use...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/resource_template_spec.rb
spec/unit/util/resource_template_spec.rb
require 'spec_helper' require 'puppet/util/resource_template' describe Puppet::Util::ResourceTemplate do describe "when initializing" do it "should fail if the template does not exist" do expect(Puppet::FileSystem).to receive(:exist?).with("/my/template").and_return(false) expect { Puppet::Util::Res...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/skip_tags_spec.rb
spec/unit/util/skip_tags_spec.rb
# coding: utf-8 require 'spec_helper' require 'puppet/util/skip_tags' describe Puppet::Util::SkipTags do let(:tagger) { Puppet::Util::SkipTags.new([]) } it "should add qualified classes as single tags" do tagger.tag("one::two::three") expect(tagger.tags).to include("one::two::three") expect(tagger.ta...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/yaml_spec.rb
spec/unit/util/yaml_spec.rb
# coding: utf-8 require 'spec_helper' require 'puppet/util/yaml' describe Puppet::Util::Yaml do include PuppetSpec::Files let(:filename) { tmpfile("yaml") } shared_examples_for 'yaml file loader' do |load_method| it 'returns false when the file is empty' do file_path = file_containing('input', '') ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/feature_spec.rb
spec/unit/util/feature_spec.rb
require 'spec_helper' require 'puppet/util/feature' describe Puppet::Util::Feature do before do @features = Puppet::Util::Feature.new("features") allow(@features).to receive(:warn) end it "should not call associated code when adding a feature" do $loaded_feature = false @features.add(:myfeature...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/errors_spec.rb
spec/unit/util/errors_spec.rb
require 'spec_helper' require 'puppet/util/errors' class ErrorTester include Puppet::Util::Errors attr_accessor :line, :file end describe Puppet::Util::Errors do before do @tester = ErrorTester.new end it "should provide a 'fail' method" do expect(@tester).to respond_to(:fail) end it "should ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/log_spec.rb
spec/unit/util/log_spec.rb
# coding: utf-8 require 'spec_helper' require 'puppet/util/log' describe Puppet::Util::Log do include PuppetSpec::Files def log_notice(message) Puppet::Util::Log.new(:level => :notice, :message => message) end it "should write a given message to the specified destination" do arraydest = [] Puppe...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/storage_spec.rb
spec/unit/util/storage_spec.rb
require 'spec_helper' require 'yaml' require 'fileutils' require 'puppet/util/storage' describe Puppet::Util::Storage do include PuppetSpec::Files before(:each) do @basepath = File.expand_path("/somepath") end describe "when caching a symbol" do it "should return an empty hash" do expect(Puppe...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/command_line_spec.rb
spec/unit/util/command_line_spec.rb
require 'spec_helper' require 'puppet/face' require 'puppet/util/command_line' describe Puppet::Util::CommandLine do include PuppetSpec::Files context "#initialize" do it "should pull off the first argument if it looks like a subcommand" do command_line = Puppet::Util::CommandLine.new("puppet", %w{ cli...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/rubygems_spec.rb
spec/unit/util/rubygems_spec.rb
require 'spec_helper' require 'puppet/util/rubygems' describe Puppet::Util::RubyGems::Source do let(:gem_path) { File.expand_path('/foo/gems') } let(:gem_lib) { File.join(gem_path, 'lib') } let(:fake_gem) { double(:full_gem_path => gem_path) } describe "::new" do it "returns NoGemsSource if rubygems is no...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/profiler/wall_clock_spec.rb
spec/unit/util/profiler/wall_clock_spec.rb
require 'spec_helper' require 'puppet/util/profiler' describe Puppet::Util::Profiler::WallClock do it "logs the number of seconds it took to execute the segment" do profiler = Puppet::Util::Profiler::WallClock.new(nil, nil) message = profiler.do_finish(profiler.start(["foo", "bar"], "Testing"), ["foo", "ba...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/profiler/logging_spec.rb
spec/unit/util/profiler/logging_spec.rb
require 'spec_helper' require 'puppet/util/profiler' describe Puppet::Util::Profiler::Logging do let(:logger) { SimpleLog.new } let(:identifier) { "Profiling ID" } let(:logging_profiler) { TestLoggingProfiler.new(logger, identifier) } let(:profiler) do p = Puppet::Util::Profiler::AroundProfiler.new p.a...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/profiler/aggregate_spec.rb
spec/unit/util/profiler/aggregate_spec.rb
require 'spec_helper' require 'puppet/util/profiler' require 'puppet/util/profiler/around_profiler' require 'puppet/util/profiler/aggregate' describe Puppet::Util::Profiler::Aggregate do let(:logger) { AggregateSimpleLog.new } let(:profiler) { Puppet::Util::Profiler::Aggregate.new(logger, nil) } let(:profiler_mg...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/profiler/object_counts_spec.rb
spec/unit/util/profiler/object_counts_spec.rb
require 'spec_helper' require 'puppet/util/profiler' describe Puppet::Util::Profiler::ObjectCounts, unless: Puppet::Util::Platform.jruby? do # ObjectSpace is not enabled by default on JRuby it "reports the changes in the system object counts" do profiler = Puppet::Util::Profiler::ObjectCounts.new(nil, nil) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/profiler/around_profiler_spec.rb
spec/unit/util/profiler/around_profiler_spec.rb
require 'spec_helper' require 'puppet/util/profiler' describe Puppet::Util::Profiler::AroundProfiler do let(:child) { TestAroundProfiler.new() } let(:profiler) { Puppet::Util::Profiler::AroundProfiler.new } before :each do profiler.add_profiler(child) end it "returns the value of the profiled segment" ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/watcher/periodic_watcher_spec.rb
spec/unit/util/watcher/periodic_watcher_spec.rb
require 'spec_helper' require 'puppet/util/watcher' describe Puppet::Util::Watcher::PeriodicWatcher do let(:enabled_timeout) { 1 } let(:disabled_timeout) { -1 } let(:a_value) { 15 } let(:a_different_value) { 16 } let(:unused_watcher) { double('unused watcher') } let(:unchanged_watcher) { a_watcher_report...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/ldap/connection_spec.rb
spec/unit/util/ldap/connection_spec.rb
require 'spec_helper' require 'puppet/util/ldap/connection' # So our mocks and such all work, even when ldap isn't available. unless Puppet.features.ldap? class LDAP class Conn def initialize(*args) end end class SSLConn < Conn; end LDAP_OPT_PROTOCOL_VERSION = 1 LDAP_OPT_REFERRALS =...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/ldap/manager_spec.rb
spec/unit/util/ldap/manager_spec.rb
require 'spec_helper' require 'puppet/util/ldap/manager' describe Puppet::Util::Ldap::Manager, :if => Puppet.features.ldap? do before do @manager = Puppet::Util::Ldap::Manager.new end it "should return self when specifying objectclasses" do expect(@manager.manages(:one, :two)).to equal(@manager) end ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/ldap/generator_spec.rb
spec/unit/util/ldap/generator_spec.rb
require 'spec_helper' require 'puppet/util/ldap/generator' describe Puppet::Util::Ldap::Generator do before do @generator = Puppet::Util::Ldap::Generator.new(:uno) end it "should require a parameter name at initialization" do expect { Puppet::Util::Ldap::Generator.new }.to raise_error(ArgumentError, /w...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/network_device/config_spec.rb
spec/unit/util/network_device/config_spec.rb
require 'spec_helper' require 'puppet/util/network_device/config' describe Puppet::Util::NetworkDevice::Config do include PuppetSpec::Files before(:each) do Puppet[:deviceconfig] = tmpfile('deviceconfig') end describe "when parsing device" do let(:config) { Puppet::Util::NetworkDevice::Config.new } ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/network_device/transport/base_spec.rb
spec/unit/util/network_device/transport/base_spec.rb
require 'spec_helper' require 'puppet/util/network_device/transport/base' describe Puppet::Util::NetworkDevice::Transport::Base do class TestTransport < Puppet::Util::NetworkDevice::Transport::Base end before(:each) do @transport = TestTransport.new end describe "when sending commands" do it "shou...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/command_line_utils/puppet_option_parser_spec.rb
spec/unit/util/command_line_utils/puppet_option_parser_spec.rb
require 'spec_helper' require 'puppet/util/command_line/puppet_option_parser' describe Puppet::Util::CommandLine::PuppetOptionParser do let(:option_parser) { described_class.new } describe "an option with a value" do it "parses a 'long' option with a value" do parses( :option => ["--angry", "Ang...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/file_spec.rb
spec/unit/util/windows/file_spec.rb
require 'spec_helper' require 'puppet/util/windows' describe Puppet::Util::Windows::File, :if => Puppet::Util::Platform.windows? do include PuppetSpec::Files let(:nonexist_file) { 'C:\foo.bar' } let(:nonexist_path) { 'C:\somefile\that\wont\ever\exist' } let(:invalid_file_attributes) { 0xFFFFFFFF } #define INV...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/string_spec.rb
spec/unit/util/windows/string_spec.rb
# encoding: UTF-8 require 'spec_helper' require 'puppet/util/windows' describe "Puppet::Util::Windows::String", :if => Puppet::Util::Platform.windows? do def wide_string(str) Puppet::Util::Windows::String.wide_string(str) end def converts_to_wide_string(string_value) expected = string_value.encode(Enco...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/adsi_spec.rb
spec/unit/util/windows/adsi_spec.rb
require 'spec_helper' require 'puppet/util/windows' describe Puppet::Util::Windows::ADSI, :if => Puppet::Util::Platform.windows? do let(:connection) { double('connection') } let(:builtin_localized) { Puppet::Util::Windows::SID.sid_to_name('S-1-5-32') } # SYSTEM is special as English can retrieve it via Windows ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/access_control_list_spec.rb
spec/unit/util/windows/access_control_list_spec.rb
require 'spec_helper' require 'puppet/util/windows' describe "Puppet::Util::Windows::AccessControlList", :if => Puppet::Util::Platform.windows? do let(:klass) { Puppet::Util::Windows::AccessControlList } let(:system_sid) { 'S-1-5-18' } let(:admins_sid) { 'S-1-5-544' } let(:none_sid) { 'S-1-0-0' } let(:sys...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/sid_spec.rb
spec/unit/util/windows/sid_spec.rb
require 'spec_helper' describe "Puppet::Util::Windows::SID", :if => Puppet::Util::Platform.windows? do if Puppet::Util::Platform.windows? require 'puppet/util/windows' end let(:subject) { Puppet::Util::Windows::SID } let(:sid) { Puppet::Util::Windows::SID::LocalSystem } let(:invalid_sid) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/root_certs_spec.rb
spec/unit/util/windows/root_certs_spec.rb
require 'spec_helper' require 'puppet/util/windows' describe "Puppet::Util::Windows::RootCerts", :if => Puppet::Util::Platform.windows? do let(:x509_store) { Puppet::Util::Windows::RootCerts.instance.to_a } it "should return at least one X509 certificate" do expect(x509_store.to_a.size).to be >= 1 end it...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/service_spec.rb
spec/unit/util/windows/service_spec.rb
require 'spec_helper' describe "Puppet::Util::Windows::Service", :if => Puppet.features.microsoft_windows? do require 'puppet/util/windows' before(:each) do allow(Puppet::Util::Windows::Error).to receive(:format_error_code) .with(anything) .and_return("fake error!") end def service_state_str(...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/api_types_spec.rb
spec/unit/util/windows/api_types_spec.rb
# encoding: UTF-8 require 'spec_helper' describe "FFI::MemoryPointer", :if => Puppet::Util::Platform.windows? do # use 2 bad bytes at end so we have even number of bytes / characters let(:bad_string) { "hello invalid world".encode(Encoding::UTF_16LE) + "\xDD\xDD".force_encoding(Encoding::UTF_16LE) } let(:bad_st...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/access_control_entry_spec.rb
spec/unit/util/windows/access_control_entry_spec.rb
require 'spec_helper' require 'puppet/util/windows' describe "Puppet::Util::Windows::AccessControlEntry", :if => Puppet::Util::Platform.windows? do let(:klass) { Puppet::Util::Windows::AccessControlEntry } let(:sid) { 'S-1-5-18' } let(:mask) { Puppet::Util::Windows::File::FILE_ALL_ACCESS } it "creates an acce...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/eventlog_spec.rb
spec/unit/util/windows/eventlog_spec.rb
require 'spec_helper' require 'puppet/util/windows' describe Puppet::Util::Windows::EventLog, :if => Puppet::Util::Platform.windows? do before(:each) { @event_log = Puppet::Util::Windows::EventLog.new } after(:each) { @event_log.close } describe "class constants" do it "should define NULL_HANDLE as 0" do ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/windows/security_descriptor_spec.rb
spec/unit/util/windows/security_descriptor_spec.rb
require 'spec_helper' require 'puppet/util/windows' describe "Puppet::Util::Windows::SecurityDescriptor", :if => Puppet::Util::Platform.windows? do let(:system_sid) { Puppet::Util::Windows::SID::LocalSystem } let(:admins_sid) { Puppet::Util::Windows::SID::BuiltinAdministrators } let(:group_sid) { Puppet::Util::W...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/package/version/pip_spec.rb
spec/unit/util/package/version/pip_spec.rb
require 'spec_helper' require 'puppet/util/package/version/pip' describe Puppet::Util::Package::Version::Pip do describe "initialization" do shared_examples_for 'a valid version' do |input_version, output = input_version| [input_version, input_version.swapcase].each do |input| it "transforms #{inpu...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/package/version/debian_spec.rb
spec/unit/util/package/version/debian_spec.rb
require 'spec_helper' require 'puppet/util/package/version/debian' describe Puppet::Util::Package::Version::Debian do context "when creating new version should fail" do it "if is parsing symbols" do expect { described_class.parse(:absent) }.to raise_error(described_class::ValidationFailure) end end ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/package/version/rpm_spec.rb
spec/unit/util/package/version/rpm_spec.rb
require 'spec_helper' require 'puppet/util/package/version/rpm' describe Puppet::Util::Package::Version::Rpm do context "when parsing an invalid version" do it "raises ArgumentError" do expect { described_class.parse(:absent)}.to raise_error(ArgumentError) end end context "when creating new versi...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/package/version/range_spec.rb
spec/unit/util/package/version/range_spec.rb
require 'spec_helper' require 'puppet/util/package/version/range' class IntegerVersion class ValidationFailure < ArgumentError; end include Comparable REGEX_FULL = '(\d+)'.freeze REGEX_FULL_RX = /\A#{REGEX_FULL}\Z/.freeze def self.parse(ver) match, version = *ver.match(REGEX_FULL_RX) raise Valida...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/util/log/destinations_spec.rb
spec/unit/util/log/destinations_spec.rb
require 'spec_helper' require 'puppet/util/json' require 'puppet/util/log' describe Puppet::Util::Log.desttypes[:report] do before do @dest = Puppet::Util::Log.desttypes[:report] end it "should require a report at initialization" do expect(@dest.new("foo").report).to eq("foo") end it "should send ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file_spec.rb
spec/unit/type/file_spec.rb
# coding: utf-8 require 'spec_helper' describe Puppet::Type.type(:file) do include PuppetSpec::Files # precomputed checksum values for FILE_CONTENT FILE_CONTENT = 'file content'.freeze CHECKSUM_VALUES = { md5: 'd10b4c3ff123b26dc068d43a8bef2d23', md5lite: 'd10b4c3ff123b26dc068d43a8bef2d23', sha256:...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
true
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/group_spec.rb
spec/unit/type/group_spec.rb
require 'spec_helper' describe Puppet::Type.type(:group) do before do @class = Puppet::Type.type(:group) end it "should have a system_groups feature" do expect(@class.provider_feature(:system_groups)).not_to be_nil end it 'should default to `present`' do expect(@class.new(:name => "foo")[:ensur...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/filebucket_spec.rb
spec/unit/type/filebucket_spec.rb
require 'spec_helper' describe Puppet::Type.type(:filebucket) do include PuppetSpec::Files describe "when validating attributes" do %w{name server port path}.each do |attr| it "should have a '#{attr}' parameter" do expect(Puppet::Type.type(:filebucket).attrtype(attr.intern)).to eq(:param) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/package_spec.rb
spec/unit/type/package_spec.rb
require 'spec_helper' describe Puppet::Type.type(:package) do before do allow(Process).to receive(:euid).and_return(0) allow(Puppet::Util::Storage).to receive(:store) end it "should have a :reinstallable feature that requires the :reinstall method" do expect(Puppet::Type.type(:package).provider_feat...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/schedule_spec.rb
spec/unit/type/schedule_spec.rb
require 'spec_helper' module ScheduleTesting def diff(unit, incr, method, count) diff = Time.now.to_i.send(method, incr * count) Time.at(diff) end def day(method, count) diff(:hour, 3600 * 24, method, count) end def hour(method, count) diff(:hour, 3600, method, count) end def min(metho...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/service_spec.rb
spec/unit/type/service_spec.rb
require 'spec_helper' def safely_load_service_type before(:each) do # We have a :confine block that calls execute in our upstart provider, which fails # on jruby. Thus, we stub it out here since we don't care to do any assertions on it. # This is only an issue if you're running these unit tests on a plat...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/noop_metaparam_spec.rb
spec/unit/type/noop_metaparam_spec.rb
require 'spec_helper' require 'puppet/type' describe Puppet::Type.type(:file).attrclass(:noop) do include PuppetSpec::Files before do allow(Puppet.settings).to receive(:use) @file = Puppet::Type.newfile :path => make_absolute("/what/ever") end it "should accept true as a value" do expect { @file...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/resources_spec.rb
spec/unit/type/resources_spec.rb
require 'spec_helper' # A type and provider that can be purged Puppet::Type.newtype(:purgeable_test) do ensurable newparam(:name) {} end Puppet::Type.type(:purgeable_test).provide(:purgeable_test) do def self.instances [] end end resources = Puppet::Type.type(:resources) # There are still plenty of tests...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/stage_spec.rb
spec/unit/type/stage_spec.rb
require 'spec_helper' describe Puppet::Type.type(:stage) do it "should have a 'name' parameter'" do expect(Puppet::Type.type(:stage).new(:name => :foo)[:name]).to eq(:foo) end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/user_spec.rb
spec/unit/type/user_spec.rb
# encoding: utf-8 require 'spec_helper' describe Puppet::Type.type(:user) do before :each do @provider_class = described_class.provide(:simple) do has_features :manages_expiry, :manages_password_age, :manages_passwords, :manages_solaris_rbac, :manages_roles, :manages_shell mk_resource_methods d...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/exec_spec.rb
spec/unit/type/exec_spec.rb
require 'spec_helper' RSpec.describe Puppet::Type.type(:exec) do include PuppetSpec::Files def exec_tester(command, exitstatus = 0, rest = {}) allow(Puppet.features).to receive(:root?).and_return(true) output = rest.delete(:output) || '' output = Puppet::Util::Execution::ProcessOutput.new(output, ex...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
true
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/whit_spec.rb
spec/unit/type/whit_spec.rb
require 'spec_helper' whit = Puppet::Type.type(:whit) describe whit do it "should stringify in a way that users will regognise" do expect(whit.new(:name => "Foo::Bar").to_s).to eq("Foo::Bar") end end
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/component_spec.rb
spec/unit/type/component_spec.rb
require 'spec_helper' component = Puppet::Type.type(:component) describe component do it "should have a :name attribute" do expect(component.attrclass(:name)).not_to be_nil end it "should use Class as its type when a normal string is provided as the title" do expect(component.new(:name => "bar").ref).t...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/tidy_spec.rb
spec/unit/type/tidy_spec.rb
require 'spec_helper' require 'puppet/file_bucket/dipper' tidy = Puppet::Type.type(:tidy) describe tidy do include PuppetSpec::Files before do @basepath = make_absolute("/what/ever") allow(Puppet.settings).to receive(:use) end context "when normalizing 'path' on windows", :if => Puppet::Util::Platfo...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/mtime_spec.rb
spec/unit/type/file/mtime_spec.rb
require 'spec_helper' describe Puppet::Type.type(:file).attrclass(:mtime) do require 'puppet_spec/files' include PuppetSpec::Files before do @filename = tmpfile('mtime') @resource = Puppet::Type.type(:file).new({:name => @filename}) end it "should be able to audit the file's mtime" do File.open...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/group_spec.rb
spec/unit/type/file/group_spec.rb
require 'spec_helper' describe Puppet::Type.type(:file).attrclass(:group) do include PuppetSpec::Files let(:path) { tmpfile('mode_spec') } let(:resource) { Puppet::Type.type(:file).new :path => path, :group => 'users' } let(:group) { resource.property(:group) } before :each do # If the provider was alr...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/mode_spec.rb
spec/unit/type/file/mode_spec.rb
require 'spec_helper' describe Puppet::Type.type(:file).attrclass(:mode) do include PuppetSpec::Files let(:path) { tmpfile('mode_spec') } let(:resource) { Puppet::Type.type(:file).new :path => path, :mode => '0644' } let(:mode) { resource.property(:mode) } describe "#validate" do it "should reject non-...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/source_spec.rb
spec/unit/type/file/source_spec.rb
require 'spec_helper' require 'uri' require 'puppet/network/http_pool' describe Puppet::Type.type(:file).attrclass(:source), :uses_checksums => true do include PuppetSpec::Files include_context 'with supported checksum types' around :each do |example| Puppet.override(:environments => Puppet::Environments::S...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/checksum_value_spec.rb
spec/unit/type/file/checksum_value_spec.rb
require 'spec_helper' describe Puppet::Type.type(:file).attrclass(:checksum_value), :uses_checksums => true do include PuppetSpec::Files include_context 'with supported checksum types' let(:path) { tmpfile('foo_bar') } let(:source_file) { file_containing('temp_foo', 'nothing at all') } let(:environment) { P...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/type_spec.rb
spec/unit/type/file/type_spec.rb
require 'spec_helper' describe Puppet::Type.type(:file).attrclass(:type) do require 'puppet_spec/files' include PuppetSpec::Files before do @filename = tmpfile('type') @resource = Puppet::Type.type(:file).new({:name => @filename}) end it "should prevent the user from trying to set the type" do ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/selinux_spec.rb
spec/unit/type/file/selinux_spec.rb
require 'spec_helper' [:seluser, :selrole, :seltype, :selrange].each do |param| property = Puppet::Type.type(:file).attrclass(param) describe property do include PuppetSpec::Files before do @path = make_absolute("/my/file") @resource = Puppet::Type.type(:file).new(:path => @path, :ensure => :f...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/owner_spec.rb
spec/unit/type/file/owner_spec.rb
require 'spec_helper' describe Puppet::Type.type(:file).attrclass(:owner) do include PuppetSpec::Files let(:path) { tmpfile('mode_spec') } let(:resource) { Puppet::Type.type(:file).new :path => path, :owner => 'joeuser' } let(:owner) { resource.property(:owner) } before :each do allow(Puppet.features)....
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/ensure_spec.rb
spec/unit/type/file/ensure_spec.rb
require 'spec_helper' describe Puppet::Type.type(:file).attrclass(:ensure) do include PuppetSpec::Files let(:path) { tmpfile('file_ensure') } let(:resource) { Puppet::Type.type(:file).new(:ensure => 'file', :path => path, :replace => true) } let(:property) { resource.property(:ensure) } it "should be a sub...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/content_spec.rb
spec/unit/type/file/content_spec.rb
require 'spec_helper' describe Puppet::Type.type(:file).attrclass(:content), :uses_checksums => true do include PuppetSpec::Files include_context 'with supported checksum types' let(:filename) { tmpfile('testfile') } let(:environment) { Puppet::Node::Environment.create(:testing, []) } let(:catalog) { Puppet...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/checksum_spec.rb
spec/unit/type/file/checksum_spec.rb
require 'spec_helper' checksum = Puppet::Type.type(:file).attrclass(:checksum) describe checksum do before do @path = Puppet::Util::Platform.windows? ? "c:/foo/bar" : "/foo/bar" @resource = Puppet::Type.type(:file).new :path => @path @checksum = @resource.parameter(:checksum) end it "should be a par...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/file/ctime_spec.rb
spec/unit/type/file/ctime_spec.rb
require 'spec_helper' describe Puppet::Type.type(:file).attrclass(:ctime) do require 'puppet_spec/files' include PuppetSpec::Files before do @filename = tmpfile('ctime') @resource = Puppet::Type.type(:file).new({:name => @filename}) end it "should be able to audit the file's ctime" do File.open...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/type/package/package_settings_spec.rb
spec/unit/type/package/package_settings_spec.rb
require 'spec_helper' describe Puppet::Type.type(:package) do before do allow(Puppet::Util::Storage).to receive(:store) end it "should have a :package_settings feature that requires :package_settings_insync?, :package_settings and :package_settings=" do expect(described_class.provider_feature(:package_s...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/resource/status_spec.rb
spec/unit/resource/status_spec.rb
require 'spec_helper' require 'puppet/resource/status' describe Puppet::Resource::Status do include PuppetSpec::Files let(:resource) { Puppet::Type.type(:file).new(:path => make_absolute("/my/file")) } let(:containment_path) { ["foo", "bar", "baz"] } let(:status) { Puppet::Resource::Status.new(resource) } ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/resource/type_spec.rb
spec/unit/resource/type_spec.rb
require 'spec_helper' require 'puppet/resource/type' require 'puppet/pops' require 'matchers/json' describe Puppet::Resource::Type do include JSONMatchers it "should have a 'name' attribute" do expect(Puppet::Resource::Type.new(:hostclass, "foo").name).to eq("foo") end [:code, :doc, :line, :file, :resour...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/resource/type_collection_spec.rb
spec/unit/resource/type_collection_spec.rb
require 'spec_helper' require 'puppet/resource/type_collection' require 'puppet/resource/type' describe Puppet::Resource::TypeCollection do include PuppetSpec::Files let(:environment) { Puppet::Node::Environment.create(:testing, []) } before do @instance = Puppet::Resource::Type.new(:hostclass, "foo") ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/resource/catalog_spec.rb
spec/unit/resource/catalog_spec.rb
require 'spec_helper' require 'puppet_spec/compiler' require 'matchers/json' describe Puppet::Resource::Catalog, "when compiling" do include JSONMatchers include PuppetSpec::Files before do @basepath = make_absolute("/somepath") # stub this to not try to create state.yaml allow(Puppet::Util::Storag...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
true
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/node/facts_spec.rb
spec/unit/node/facts_spec.rb
require 'spec_helper' require 'puppet/node/facts' require 'matchers/json' describe Puppet::Node::Facts, "when indirecting" do include JSONMatchers before do @facts = Puppet::Node::Facts.new("me") end describe "adding local facts" do it "should add the node's certificate name as the 'clientcert' fact"...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/node/environment_spec.rb
spec/unit/node/environment_spec.rb
require 'spec_helper' require 'tmpdir' require 'puppet/node/environment' require 'puppet/util/execution' require 'puppet_spec/modules' require 'puppet/parser/parser_factory' describe Puppet::Node::Environment do let(:env) { Puppet::Node::Environment.create("testing", []) } include PuppetSpec::Files context '...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/transaction/resource_harness_spec.rb
spec/unit/transaction/resource_harness_spec.rb
require 'spec_helper' require 'puppet/transaction/resource_harness' describe Puppet::Transaction::ResourceHarness do include PuppetSpec::Files before do @mode_750 = Puppet::Util::Platform.windows? ? '644' : '750' @mode_755 = Puppet::Util::Platform.windows? ? '644' : '755' path = make_absolute("/my/fi...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/transaction/report_spec.rb
spec/unit/transaction/report_spec.rb
require 'spec_helper' require 'puppet_spec/compiler' require 'puppet' require 'puppet/transaction/report' require 'matchers/json' describe Puppet::Transaction::Report do include JSONMatchers include PuppetSpec::Files include PuppetSpec::Compiler before do allow(Puppet::Util::Storage).to receive(:store) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/transaction/additional_resource_generator_spec.rb
spec/unit/transaction/additional_resource_generator_spec.rb
require 'spec_helper' require 'puppet/transaction' require 'puppet_spec/compiler' require 'matchers/relationship_graph_matchers' require 'matchers/include_in_order' require 'matchers/resource' describe Puppet::Transaction::AdditionalResourceGenerator do include PuppetSpec::Compiler include PuppetSpec::Files incl...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/transaction/event_spec.rb
spec/unit/transaction/event_spec.rb
require 'spec_helper' require 'puppet/transaction/event' class TestResource def to_s "Foo[bar]" end def [](v) nil end end describe Puppet::Transaction::Event do include PuppetSpec::Files it "should support resource" do event = Puppet::Transaction::Event.new event.resource = TestResource....
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/transaction/event_manager_spec.rb
spec/unit/transaction/event_manager_spec.rb
require 'spec_helper' require 'puppet/transaction/event_manager' describe Puppet::Transaction::EventManager do include PuppetSpec::Files describe "at initialization" do it "should require a transaction" do expect(Puppet::Transaction::EventManager.new("trans").transaction).to eq("trans") end end ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/transaction/persistence_spec.rb
spec/unit/transaction/persistence_spec.rb
require 'spec_helper' require 'yaml' require 'fileutils' require 'puppet/transaction/persistence' describe Puppet::Transaction::Persistence do include PuppetSpec::Files before(:each) do @basepath = File.expand_path("/somepath") end describe "when loading from file" do before do allow(Puppet.se...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/interface/action_spec.rb
spec/unit/interface/action_spec.rb
require 'spec_helper' require 'puppet/interface' describe Puppet::Interface::Action do describe "when validating the action name" do [nil, '', 'foo bar', '-foobar'].each do |input| it "should treat #{input.inspect} as an invalid name" do expect { Puppet::Interface::Action.new(nil, input) ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/interface/documentation_spec.rb
spec/unit/interface/documentation_spec.rb
require 'spec_helper' require 'puppet/interface' class Puppet::Interface::TinyDocs::Test include Puppet::Interface::TinyDocs attr_accessor :name, :options, :display_global_options def initialize self.name = "tinydoc-test" self.options = [] self.display_global_options = [] end def get_option(n...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/interface/action_builder_spec.rb
spec/unit/interface/action_builder_spec.rb
require 'spec_helper' require 'puppet/interface' require 'puppet/network/format_handler' describe Puppet::Interface::ActionBuilder do let :face do Puppet::Interface.new(:puppet_interface_actionbuilder, '0.0.1') end it "should build an action" do action = Puppet::Interface::ActionBuilder.build(face, :foo) do ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/interface/option_spec.rb
spec/unit/interface/option_spec.rb
require 'spec_helper' require 'puppet/interface' describe Puppet::Interface::Option do let :face do Puppet::Interface.new(:option_testing, '0.0.1') end describe "#optparse_to_name" do ["", "=BAR", " BAR", "=bar", " bar"].each do |postfix| { "--foo" => :foo, "-f" => :f }.each do |base, expect| in...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/interface/face_collection_spec.rb
spec/unit/interface/face_collection_spec.rb
require 'spec_helper' require 'tmpdir' require 'puppet/interface' describe Puppet::Interface::FaceCollection do # To prevent conflicts with other specs that use faces, we must save and restore global state. # Because there are specs that do 'describe Puppet::Face[...]', we must restore the same objects otherwise...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/interface/option_builder_spec.rb
spec/unit/interface/option_builder_spec.rb
require 'spec_helper' require 'puppet/interface' describe Puppet::Interface::OptionBuilder do let :face do Puppet::Interface.new(:option_builder_testing, '0.0.1') end it "should be able to construct an option without a block" do expect(Puppet::Interface::OptionBuilder.build(face, "--foo")). to be_an_ins...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/interface/action_manager_spec.rb
spec/unit/interface/action_manager_spec.rb
require 'spec_helper' require 'puppet/interface' class ActionManagerTester include Puppet::Interface::ActionManager end describe Puppet::Interface::ActionManager do subject { ActionManagerTester.new } describe "when included in a class" do it "should be able to define an action" do subject.action(:f...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/graph/key_spec.rb
spec/unit/graph/key_spec.rb
require 'spec_helper' require 'puppet/graph' describe Puppet::Graph::Key do it "produces the next in the sequence" do key = Puppet::Graph::Key.new expect(key.next).to be > key end it "produces a key after itself but before next" do key = Puppet::Graph::Key.new expect(key.down).to be > key ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/graph/simple_graph_spec.rb
spec/unit/graph/simple_graph_spec.rb
require 'spec_helper' require 'puppet/graph' describe Puppet::Graph::SimpleGraph do it "should return the number of its vertices as its length" do @graph = Puppet::Graph::SimpleGraph.new @graph.add_vertex("one") @graph.add_vertex("two") expect(@graph.size).to eq(2) end it "should consider itself...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/graph/rb_tree_map_spec.rb
spec/unit/graph/rb_tree_map_spec.rb
require 'spec_helper' require 'puppet/graph' describe Puppet::Graph::RbTreeMap do describe "#push" do it "should allow a new element to be added" do subject[5] = 'foo' expect(subject.size).to eq(1) expect(subject[5]).to eq('foo') end it "should replace the old value if the key is in ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/graph/sequential_prioritizer_spec.rb
spec/unit/graph/sequential_prioritizer_spec.rb
require 'spec_helper' require 'puppet/graph' describe Puppet::Graph::SequentialPrioritizer do let(:priorities) { Puppet::Graph::SequentialPrioritizer.new } it "generates priorities that maintain the sequence" do first = priorities.generate_priority_for("one") second = priorities.generate_priority_for("two...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/graph/relationship_graph_spec.rb
spec/unit/graph/relationship_graph_spec.rb
require 'spec_helper' require 'puppet/graph' require 'puppet_spec/compiler' require 'matchers/include_in_order' require 'matchers/relationship_graph_matchers' describe Puppet::Graph::RelationshipGraph do include PuppetSpec::Files include PuppetSpec::Compiler include RelationshipGraphMatchers let(:graph) { Pu...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/settings/port_setting_spec.rb
spec/unit/settings/port_setting_spec.rb
require 'spec_helper' require 'puppet/settings' require 'puppet/settings/port_setting' describe Puppet::Settings::PortSetting do let(:setting) { described_class.new(:settings => double('settings'), :desc => "test") } it "is of type :port" do expect(setting.type).to eq(:port) end describe "when munging t...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/settings/directory_setting_spec.rb
spec/unit/settings/directory_setting_spec.rb
require 'spec_helper' require 'puppet/settings' require 'puppet/settings/directory_setting' describe Puppet::Settings::DirectorySetting do DirectorySetting = Puppet::Settings::DirectorySetting include PuppetSpec::Files before do @basepath = make_absolute("/somepath") end describe "when being converte...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/settings/integer_setting_spec.rb
spec/unit/settings/integer_setting_spec.rb
require 'spec_helper' require 'puppet/settings' require 'puppet/settings/integer_setting' describe Puppet::Settings::IntegerSetting do let(:setting) { described_class.new(:settings => double('settings'), :desc => "test") } it "is of type :integer" do expect(setting.type).to eq(:integer) end describe "wh...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/settings/http_extra_headers_spec.rb
spec/unit/settings/http_extra_headers_spec.rb
require 'spec_helper' require 'puppet/settings' require 'puppet/settings/http_extra_headers_setting' describe Puppet::Settings::HttpExtraHeadersSetting do subject { described_class.new(:settings => double('settings'), :desc => "test") } it "is of type :http_extra_headers" do expect(subject.type).to eq :http_...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/settings/file_setting_spec.rb
spec/unit/settings/file_setting_spec.rb
require 'spec_helper' require 'puppet/settings' require 'puppet/settings/file_setting' describe Puppet::Settings::FileSetting do FileSetting = Puppet::Settings::FileSetting include PuppetSpec::Files describe "when controlling permissions" do def settings(wanted_values = {}) real_values = { ...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/settings/config_file_spec.rb
spec/unit/settings/config_file_spec.rb
require 'spec_helper' require 'puppet/settings/config_file' describe Puppet::Settings::ConfigFile do NOTHING = {} def the_parse_of(*lines) config.parse_file(filename, lines.join("\n")) end let(:identity_transformer) { Proc.new { |value| value } } let(:config) { Puppet::Settings::ConfigFile.new(identity...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false
puppetlabs/puppet
https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/spec/unit/settings/string_setting_spec.rb
spec/unit/settings/string_setting_spec.rb
require 'spec_helper' require 'puppet/settings' require 'puppet/settings/string_setting' describe Puppet::Settings::StringSetting do StringSetting = Puppet::Settings::StringSetting before(:each) do @test_setting_name = :test_setting @test_setting_default = "my_crazy_default/$var" @application_setting...
ruby
Apache-2.0
e227c27540975c25aa22d533a52424a9d2fc886a
2026-01-04T15:39:26.576514Z
false