Sha256: dfac29669c20bc7b6285a3ce4ee59fd1c8700dfd72571e4ffd6f196c40b55b9c

Contents?: true

Size: 1018 Bytes

Versions: 93

Compression:

Stored size: 1018 Bytes

Contents

require "spec_helper"
require "facter/version"
require 'pathname'

describe "Facter.version Public API" do
  before :each do
    Facter.instance_eval do
      if @facter_version
        @facter_version = nil
      end
    end
  end

  context "without a VERSION file" do
    before :each do
      Facter.stubs(:read_version_file).returns(nil)
    end

    it "is Facter::FACTERVERSION" do
      Facter.version.should == Facter::FACTERVERSION
    end
    it "respects the version= setter" do
      Facter.version = '1.2.3'
      Facter.version.should == '1.2.3'
    end
  end

  context "with a VERSION file" do
    it "is the content of the file" do
      Facter.expects(:read_version_file).with() do |path|
        pathname = Pathname.new(path)
        pathname.basename.to_s == "VERSION"
      end.returns('1.6.14-6-gea42046')

      Facter.version.should == '1.6.14-6-gea42046'
    end
    it "respects the version= setter" do
      Facter.version = '1.2.3'
      Facter.version.should == '1.2.3'
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
facter-2.5.7 spec/unit/version_spec.rb
facter-2.5.7-x86-mingw32 spec/unit/version_spec.rb
facter-2.5.7-x64-mingw32 spec/unit/version_spec.rb
facter-2.5.7-universal-darwin spec/unit/version_spec.rb
facter-2.5.6-x86-mingw32 spec/unit/version_spec.rb
facter-2.5.6-x64-mingw32 spec/unit/version_spec.rb
facter-2.5.6-universal-darwin spec/unit/version_spec.rb
facter-2.5.6 spec/unit/version_spec.rb
facter-2.5.5-x86-mingw32 spec/unit/version_spec.rb
facter-2.5.5-x64-mingw32 spec/unit/version_spec.rb
facter-2.5.5-universal-darwin spec/unit/version_spec.rb
facter-2.5.5 spec/unit/version_spec.rb
facter-2.5.4-x86-mingw32 spec/unit/version_spec.rb
facter-2.5.4-x64-mingw32 spec/unit/version_spec.rb
facter-2.5.4-universal-darwin spec/unit/version_spec.rb
facter-2.5.4 spec/unit/version_spec.rb
facter-2.5.1 spec/unit/version_spec.rb
facter-2.5.1-x86-mingw32 spec/unit/version_spec.rb
facter-2.5.1-x64-mingw32 spec/unit/version_spec.rb
facter-2.5.1-universal-darwin spec/unit/version_spec.rb