Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions spec/unit/mutant/license/opensource/repository_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

RSpec.describe Mutant::License::Subscription::Opensource::Repository do
describe '.parse' do
it 'can parse SSH remotes' do
expect(described_class.parse('[email protected]:mbj/mutant.git')).to eql(
described_class.new('github.com', 'mbj/mutant.git')
)
end
# or it should maybe more likely be:
it 'can parse SSH remotes' do
expect(described_class.parse('[email protected]:mbj/mutant.git')).to eql(
described_class.new('github.com', 'mbj/mutant')
)
end

it 'can parse https remotes' do
expect(described_class.parse('https://github.example.com/org/repo')).to eql(
described_class.new('github.example.com', 'org/repo')
)
end

it 'can parse https remotes with a wildcard' do
expect(described_class.parse('https://github.com/*')).to eql(
described_class.new('github.com', '/*')
)
end
end
end