Sha256: 6912f2c593aefc3f8f64ea3aa04aba00e164b1bec6c722b2e34903c35fc3f462

Contents?: true

Size: 1.56 KB

Versions: 100

Compression:

Stored size: 1.56 KB

Contents

shared_examples_for "a file_serving model" do
  include PuppetSpec::Files

  describe "#indirection" do
    localpath = PuppetSpec::Files.make_absolute("/etc/sudoers")
    localurl = "file://" + localpath

    before :each do
      # Never connect to the network, no matter what
      allow_any_instance_of(described_class.indirection.terminus(:rest).class).to receive(:find)
    end

    describe "when running the apply application" do
      before :each do
        Puppet[:default_file_terminus] = 'file_server'
      end

      {
       localpath => :file,
       localurl => :file,
       "puppet:///modules/foo/bar"       => :file_server,
       "puppet://server/modules/foo/bar" => :rest,
      }.each do |key, terminus|
        it "should use the #{terminus} terminus when requesting #{key.inspect}" do
          expect_any_instance_of(described_class.indirection.terminus(terminus).class).to receive(:find)

          described_class.indirection.find(key)
        end
      end
    end

    describe "when running another application" do
      before :each do
        Puppet[:default_file_terminus] = 'rest'
      end

      {
       localpath => :file,
       localurl => :file,
       "puppet:///modules/foo/bar"       => :rest,
       "puppet://server/modules/foo/bar" => :rest,
      }.each do |key, terminus|
        it "should use the #{terminus} terminus when requesting #{key.inspect}" do
          expect_any_instance_of(described_class.indirection.terminus(terminus).class).to receive(:find)

          described_class.indirection.find(key)
        end
      end
    end
  end
end

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
puppet-6.17.0 spec/shared_behaviours/file_serving_model.rb
puppet-6.17.0-x86-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.17.0-x64-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.17.0-universal-darwin spec/shared_behaviours/file_serving_model.rb
puppet-6.16.0 spec/shared_behaviours/file_serving_model.rb
puppet-6.16.0-x86-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.16.0-x64-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.16.0-universal-darwin spec/shared_behaviours/file_serving_model.rb
puppet-6.15.0 spec/shared_behaviours/file_serving_model.rb
puppet-6.15.0-x86-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.15.0-x64-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.15.0-universal-darwin spec/shared_behaviours/file_serving_model.rb
puppet-6.14.0 spec/shared_behaviours/file_serving_model.rb
puppet-6.14.0-x86-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.14.0-x64-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.14.0-universal-darwin spec/shared_behaviours/file_serving_model.rb
puppet-6.13.0 spec/shared_behaviours/file_serving_model.rb
puppet-6.13.0-x86-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.13.0-x64-mingw32 spec/shared_behaviours/file_serving_model.rb
puppet-6.13.0-universal-darwin spec/shared_behaviours/file_serving_model.rb