Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demonstrate strange parsing behavior for repository-based licenses #1369

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
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('git@github.com: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('git@github.com: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