Sha256: fd700aa53b32a2a143a63a56f65f171e023846b228e81f06a93da697c197d067

Contents?: true

Size: 1.27 KB

Versions: 77

Compression:

Stored size: 1.27 KB

Contents

#! /usr/bin/env ruby
require 'spec_helper'
require 'puppet'
require 'puppet_spec/files'
require 'semver'

describe Puppet do
  include PuppetSpec::Files

  context "#version" do
    it "should be valid semver" do
      expect(SemVer).to be_valid Puppet.version
    end
  end

  Puppet::Util::Log.eachlevel do |level|
    it "should have a method for sending '#{level}' logs" do
      expect(Puppet).to respond_to(level)
    end
  end

  it "should be able to change the path" do
    newpath = ENV["PATH"] + File::PATH_SEPARATOR + "/something/else"
    Puppet[:path] = newpath
    expect(ENV["PATH"]).to eq(newpath)
  end

  it "should change $LOAD_PATH when :libdir changes" do
    one = tmpdir('load-path-one')
    two = tmpdir('load-path-two')
    expect(one).not_to eq(two)

    Puppet[:libdir] = one
    expect($LOAD_PATH).to include one
    expect($LOAD_PATH).not_to include two

    Puppet[:libdir] = two
    expect($LOAD_PATH).not_to include one
    expect($LOAD_PATH).to include two
  end

  context "newtype" do
    it "should issue a deprecation warning" do
      subject.expects(:deprecation_warning).with("Creating sometype via Puppet.newtype is deprecated and will be removed in a future release. Use Puppet::Type.newtype instead.")
      subject.newtype("sometype")
    end
  end
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
puppet-4.8.2 spec/unit/puppet_spec.rb
puppet-4.8.2-x86-mingw32 spec/unit/puppet_spec.rb
puppet-4.8.2-x64-mingw32 spec/unit/puppet_spec.rb
puppet-4.8.2-universal-darwin spec/unit/puppet_spec.rb
puppet-4.7.1 spec/unit/puppet_spec.rb
puppet-4.7.1-x86-mingw32 spec/unit/puppet_spec.rb
puppet-4.7.1-x64-mingw32 spec/unit/puppet_spec.rb
puppet-4.7.1-universal-darwin spec/unit/puppet_spec.rb
puppet-4.8.1 spec/unit/puppet_spec.rb
puppet-4.8.1-x86-mingw32 spec/unit/puppet_spec.rb
puppet-4.8.1-x64-mingw32 spec/unit/puppet_spec.rb
puppet-4.8.1-universal-darwin spec/unit/puppet_spec.rb
puppet-4.8.0 spec/unit/puppet_spec.rb
puppet-4.8.0-x86-mingw32 spec/unit/puppet_spec.rb
puppet-4.8.0-x64-mingw32 spec/unit/puppet_spec.rb
puppet-4.8.0-universal-darwin spec/unit/puppet_spec.rb
puppet-4.7.0 spec/unit/puppet_spec.rb
puppet-4.7.0-x86-mingw32 spec/unit/puppet_spec.rb
puppet-4.7.0-x64-mingw32 spec/unit/puppet_spec.rb
puppet-4.7.0-universal-darwin spec/unit/puppet_spec.rb