Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
fnxpt authored Oct 23, 2023
1 parent 78bec05 commit c2df7dd
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions spec/lockfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,39 @@ def self.specs_by_source
spec_repos_data.should == { 'trunk' => %w(a b C) }
end
end

describe '#generate_spec_repos_with_duplicated_source' do
it 'merges specs if sources have same key' do
spec_repos = {
Source.new(fixture('spec-repos/trunk')) => [
Specification.new do |s|
s.name = 'a'
s.version = '1.0'
end,
Specification.new do |s|
s.name = 'b'
s.version = '1.0'
end,
Specification.new do |s|
s.name = 'C'
s.version = '1.0'
end,
],
Source.new(fixture('spec-repos/trunk')) => [
Specification.new do |s|
s.name = 'd'
s.version = '1.0'
end,
Specification.new do |s|
s.name = 'E'
s.version = '1.0'
end,
],
}
spec_repos_data = Lockfile.send(:generate_spec_repos, spec_repos)
spec_repos_data.should == { 'trunk' => %w(a b C d E) }
end
end
end
end
end

0 comments on commit c2df7dd

Please sign in to comment.