Sha256: d4fb64a5b75f05d81c20ed571d988fe5a8ae17a585ff94f512547551c48cb8e9

Contents?: true

Size: 1.23 KB

Versions: 79

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", "master")
      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

79 entries across 79 versions & 1 rubygems

Version Path
packaging-0.99.75 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.74 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.73 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.72 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.71 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.70 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.69 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.68 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.67 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.66 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.65 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.64 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.63 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.62 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.61 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.60 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.59 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.58 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.57 spec/lib/packaging/util/git_tag_spec.rb
packaging-0.99.56 spec/lib/packaging/util/git_tag_spec.rb