Sha256: c2a33ca55132115baa88f48dd59dd5ceefec5edff945d4b4855accf744564c98

Contents?: true

Size: 1.24 KB

Versions: 33

Compression:

Stored size: 1.24 KB

Contents

# -*- ruby -*-
require 'spec_helper'

describe "Pkg::Util::Git_tag" do
  context "parse_ref!" do
    it "fails for a ref that doesn't exist'" do
      expect { Pkg::Util::Git_tag.new("https://github.com/puppetlabs/leatherman.git", "garbagegarbage") }.to raise_error(RuntimeError, /ERROR : Not a ref or sha!/)
    end
  end

  context "sha?" do
    it "sets ref type as a sha when passed a sha" do
      git_tag = Pkg::Util::Git_tag.new("https://github.com/puppetlabs/leatherman.git", "4eef05389ebf418b62af17406c7f9f13fa51f975")
      expect(git_tag.sha?).to eq(true)
    end
  end

  context "branch?" do
    it "sets ref type as a branch when passed a branch" do
      git_tag = Pkg::Util::Git_tag.new("https://github.com/puppetlabs/leatherman.git", "main")
      expect(git_tag.branch?).to eq(true)
    end
  end

  context "tag?" do
    it "sets ref type as a tag when passed a tag" do
      git_tag = Pkg::Util::Git_tag.new("https://github.com/puppetlabs/leatherman.git", "tags/0.6.2")
      expect(git_tag.tag?).to eq(true)
    end

    it "sets ref type as a tag when passed a fully qualified tag" do
      git_tag = Pkg::Util::Git_tag.new("https://github.com/puppetlabs/leatherman.git", "refs/tags/0.6.2")
      expect(git_tag.tag?).to eq(true)
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
packaging-0.122.3 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.122.2 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.122.1 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.122.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.121.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.120.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.118.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.117.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.116.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.115.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.114.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.113.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.112.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.111.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.110.1 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.110.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.109.7 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.109.6 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.109.5 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.109.4 spec/lib/packaging/util/git_tag_spec.rb