summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/integration/rubygems/offline_index_spec.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/integration/rubygems/offline_index_spec.rb b/spec/integration/rubygems/offline_index_spec.rb
index 459d3e1..3897979 100644
--- a/spec/integration/rubygems/offline_index_spec.rb
+++ b/spec/integration/rubygems/offline_index_spec.rb
@@ -1,15 +1,18 @@
# frozen_string_literal: true
RSpec.describe Spandx::Rubygems::OfflineIndex do
- subject { described_class.new(:rubygems) }
+ subject { described_class.new(package_manager, url: url) }
+
+ let(:package_manager) { :rubygems }
+ let(:url) { "https://github.com/mokhan/spandx-#{package_manager}.git" }
describe '#licenses_for' do
(0x00..0xFF).map { |x| x.to_s(16).upcase.rjust(2, '0').downcase }.each do |hex|
context hex do
- let(:path) { subject.db.expand_path(".index/#{hex}/rubygems") }
+ let(:path) { subject.db.expand_path(".index/#{hex}/#{package_manager}") }
it 'is able to find all packages in the index' do
- CSV.readlines(path).shuffle.each do |row|
+ CSV.foreach(path) do |row|
results = subject.licenses_for(name: row[0], version: row[1])
expect(results).to match_array(row[2].split('-|-'))
end