Sha256: c19ca3d5f2145858064b6cf692685c70c02f73ff5161122b0349f7534a09e451

Contents?: true

Size: 1.4 KB

Versions: 53

Compression:

Stored size: 1.4 KB

Contents

#! /usr/bin/env ruby

require 'spec_helper'

require 'puppet/file_bucket/file'

describe Puppet::FileBucket::File do
  describe "#indirection" do
    before :each do
      # Never connect to the network, no matter what
      described_class.indirection.terminus(:rest).class.any_instance.stubs(:find)
    end

    describe "when running the master application" do
      before :each do
        Puppet::Application[:master].setup_terminuses
      end

      {
        "md5/d41d8cd98f00b204e9800998ecf8427e" => :file,
        "https://puppetmaster:8140/production/file_bucket_file/md5/d41d8cd98f00b204e9800998ecf8427e" => :file,
      }.each do |key, terminus|
        it "should use the #{terminus} terminus when requesting #{key.inspect}" do
          described_class.indirection.terminus(terminus).class.any_instance.expects(:find)

          described_class.indirection.find(key)
        end
      end
    end

    describe "when running another application" do
      {
        "md5/d41d8cd98f00b204e9800998ecf8427e" => :file,
        "https://puppetmaster:8140/production/file_bucket_file/md5/d41d8cd98f00b204e9800998ecf8427e" => :rest,
      }.each do |key, terminus|
        it "should use the #{terminus} terminus when requesting #{key.inspect}" do
          described_class.indirection.terminus(terminus).class.any_instance.expects(:find)

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

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
puppet-3.6.2 spec/integration/file_bucket/file_spec.rb
puppet-3.6.2-x86-mingw32 spec/integration/file_bucket/file_spec.rb
puppet-3.6.1 spec/integration/file_bucket/file_spec.rb
puppet-3.6.1-x86-mingw32 spec/integration/file_bucket/file_spec.rb
puppet-3.6.0 spec/integration/file_bucket/file_spec.rb
puppet-3.6.0-x86-mingw32 spec/integration/file_bucket/file_spec.rb
puppet-3.6.0.rc1 spec/integration/file_bucket/file_spec.rb
puppet-3.6.0.rc1-x86-mingw32 spec/integration/file_bucket/file_spec.rb
puppet-3.5.1 spec/integration/file_bucket/file_spec.rb
puppet-3.5.1-x86-mingw32 spec/integration/file_bucket/file_spec.rb
puppet-3.5.1.rc1 spec/integration/file_bucket/file_spec.rb
puppet-3.5.1.rc1-x86-mingw32 spec/integration/file_bucket/file_spec.rb
puppet-3.5.0.rc3 spec/integration/file_bucket/file_spec.rb
puppet-3.5.0.rc3-x86-mingw32 spec/integration/file_bucket/file_spec.rb
puppet-3.5.0.rc2 spec/integration/file_bucket/file_spec.rb
puppet-3.5.0.rc2-x86-mingw32 spec/integration/file_bucket/file_spec.rb
puppet-3.5.0.rc1 spec/integration/file_bucket/file_spec.rb
puppet-3.5.0.rc1-x86-mingw32 spec/integration/file_bucket/file_spec.rb
puppet-3.4.3 spec/integration/file_bucket/file_spec.rb
puppet-3.4.2 spec/integration/file_bucket/file_spec.rb