Sha256: 0b41e617c70b8e74e49002700eab9ff5634b268f08713aa44623799e22b4f4e4

Contents?: true

Size: 985 Bytes

Versions: 14

Compression:

Stored size: 985 Bytes

Contents

describe Hem::Helper do
  describe 'parse_github_url' do

    it 'should return the parts of a git protocol url' do
      url = 'git://github.com/foo/bar'
      expect(parse_github_url(url)).to eq({:owner => 'foo', :repo => 'bar'})
    end

    it 'should return the parts of an https url' do
      url = 'https://github.com/foo/bar'
      expect(parse_github_url(url)).to eq({:owner => 'foo', :repo => 'bar'})
    end

    it 'should return the parts of a git ssh url' do
      url = 'git@github.com:foo/bar'
      expect(parse_github_url(url)).to eq({:owner => 'foo', :repo => 'bar'})
    end

    it 'should trim the .git https url ending if present' do
      url = 'https://github.com/foo/bar.git'
      expect(parse_github_url(url)).to eq({:owner => 'foo', :repo => 'bar'})
    end

    it 'should trim the .git ssh url ending if present' do
      url = 'git@github.com:foo/bar.git'
      expect(parse_github_url(url)).to eq({:owner => 'foo', :repo => 'bar'})
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hem-1.2.4 spec/hem/helpers/github_spec.rb
hem-1.2.3 spec/hem/helpers/github_spec.rb
hem-1.2.2 spec/hem/helpers/github_spec.rb
hem-1.2.1 spec/hem/helpers/github_spec.rb
hem-1.2.0 spec/hem/helpers/github_spec.rb
hem-1.1.2 spec/hem/helpers/github_spec.rb
hem-1.1.1 spec/hem/helpers/github_spec.rb
hem-1.1.0 spec/hem/helpers/github_spec.rb
hem-1.0.1.beta6 spec/hem/helpers/github_spec.rb
hem-1.0.1.beta5 spec/hem/helpers/github_spec.rb
hem-1.0.1.beta4 spec/hem/helpers/github_spec.rb
hem-1.0.1.beta3 spec/hem/helpers/github_spec.rb
hem-1.0.1.beta2 spec/hem/helpers/github_spec.rb
hem-1.0.1.beta1 spec/hem/helpers/github_spec.rb