Sha256: 25f93ac849bd1b258acc896f1cf08d3e1b663e0f4ac990064c6df9ebb6b249d7

Contents?: true

Size: 1 KB

Versions: 15

Compression:

Stored size: 1 KB

Contents

require "spec_helper"
require "hiera/version"
require 'pathname'

describe "Hiera.version Public API" do
  subject() { Hiera }

  before :each do
    Hiera.instance_eval do
      if @hiera_version
        @hiera_version = nil
      end
    end
  end

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

    it "is Hiera::VERSION" do
      subject.version.should == Hiera::VERSION
    end
    it "respects the version= setter" do
      subject.version = '1.2.3'
      subject.version.should == '1.2.3'
    end
  end

  context "with a VERSION file" do
    it "is the content of the file" do
      subject.expects(:read_version_file).with() do |path|
        pathname = Pathname.new(path)
        pathname.basename.to_s == "VERSION"
      end.returns('1.2.1-9-g9fda440')

      subject.version.should == '1.2.1-9-g9fda440'
    end
    it "respects the version= setter" do
      subject.version = '1.2.3'
      subject.version.should == '1.2.3'
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
hiera-3.0.1 spec/unit/version_spec.rb
hiera-3.0.1-x86-mingw32 spec/unit/version_spec.rb
hiera-3.0.1-x64-mingw32 spec/unit/version_spec.rb
hiera-2.0.0 spec/unit/version_spec.rb
hiera-2.0.0-x86-mingw32 spec/unit/version_spec.rb
hiera-2.0.0-x64-mingw32 spec/unit/version_spec.rb
hiera-1.3.4 spec/unit/version_spec.rb
hiera-1.3.3 spec/unit/version_spec.rb
hiera-1.3.2 spec/unit/version_spec.rb
hiera-1.3.2.rc2 spec/unit/version_spec.rb
hiera-1.3.2.rc1 spec/unit/version_spec.rb
hiera-1.3.1 spec/unit/version_spec.rb
hiera-1.3.1.rc1 spec/unit/version_spec.rb
hiera-1.3.0 spec/unit/version_spec.rb
hiera-1.3.0.rc2 spec/unit/version_spec.rb