Sha256: 1e42f313ce831f24ba1e7a18a370e64d283e46c617872021f1ee7594be9256a5

Contents?: true

Size: 1.23 KB

Versions: 14

Compression:

Stored size: 1.23 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("git://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("git://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("git://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("git://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("git://github.com/puppetlabs/leatherman.git", "refs/tags/0.6.2")
      expect(git_tag.tag?).to eq(true)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
packaging-0.106.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.105.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.104.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.103.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.102.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.101.0 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.82 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.81 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.80 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.79 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.78 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.77 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.88.77 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.76 spec/lib/packaging/util/git_tag_spec.rb