Sha256: 40474bf24492caf68dd40b93193a91d7994f7afb158f094dd8f4d292ee7e59f6

Contents?: true

Size: 888 Bytes

Versions: 16

Compression:

Stored size: 888 Bytes

Contents

require 'spec_helper'
RSpec.describe Learn::RepoParser do
  context "URLs from github" do
    let!(:remote) { OpenStruct.new(:url => nil)}
    let!(:repo) { OpenStruct.new(:remote => remote)}

    it "supports ssh addresses" do
      expect(Git).to receive(:open).and_return(repo)
      remote.url = "git@github.com:flatiron-labs/learn-gem.git"
      expect(described_class.get_repo).to eq("learn-gem")
    end

    it "supports http addresses" do
      expect(Git).to receive(:open).and_return(repo)
      remote.url = "https://github.com/flatiron-labs/learn-gem.git"
      expect(described_class.get_repo).to eq("learn-gem")
    end

    it "supports http addresses without .git extension" do
      expect(Git).to receive(:open).and_return(repo)
      remote.url = "https://github.com/flatiron-labs/learn-gem"
      expect(described_class.get_repo).to eq("learn-gem")
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
learn-test-1.2.26 spec/repo_parser_spec.rb
learn-test-1.2.25 spec/repo_parser_spec.rb
learn-test-1.2.24 spec/repo_parser_spec.rb
learn-test-1.2.23 spec/repo_parser_spec.rb
learn-test-1.2.22 spec/repo_parser_spec.rb
learn-test-1.2.21 spec/repo_parser_spec.rb
learn-test-1.2.2 spec/repo_parser_spec.rb
learn-test-1.2.1 spec/repo_parser_spec.rb
learn-test-1.2.0 spec/repo_parser_spec.rb
learn-test-1.1.1 spec/repo_parser_spec.rb
learn-test-1.1.0 spec/repo_parser_spec.rb
learn-co-1.0.4 spec/repo_parser_spec.rb
learn-co-1.0.3 spec/repo_parser_spec.rb
learn-co-1.0.2 spec/repo_parser_spec.rb
learn-co-1.0.1 spec/repo_parser_spec.rb
learn-co-1.0.0 spec/repo_parser_spec.rb