Sha256: d6ab61f7245f09eb3e363586a7fc7724f8eb78a09542fa18c89c967f5ce936af

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

require_relative "../../spec_helper.rb"
require_relative "../../../lib/vendorise/parser"

module Vendorise
  describe Parser do
    describe :gem_url do
      it "is nil for pure whitespace urls" do
        expect(Vendorise::Parser.gem_url("     ")).to eq nil
      end

      it "is nil for nil urls" do
        expect(Vendorise::Parser.gem_url(nil)).to eq nil
      end

      it "is a http url for a http url" do
        expect(Vendorise::Parser.gem_url("https://github.com/New-Bamboo/vendorise.git")).to eq "https://github.com/New-Bamboo/vendorise.git"
      end

      it "is a ssh url for a ssh url" do
        expect(Vendorise::Parser.gem_url("git@github.com:New-Bamboo/vendorise.git")).to eq "git@github.com:New-Bamboo/vendorise.git"
      end
    end

    describe :gem_name do
      it "is the last part of the path for a http url" do
        expect(Vendorise::Parser.gem_name("https://github.com/New-Bamboo/vendorise.git")).to eq "vendorise"
      end

      it "is the last part of the path for a ssh url" do
        expect(Vendorise::Parser.gem_name("git@github.com:New-Bamboo/vendorise.git")).to eq "vendorise"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vendorise-0.1.1 spec/lib/vendorise/parser_spec.rb
vendorise-0.1.0 spec/lib/vendorise/parser_spec.rb