diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-17 17:39:11 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-03-17 17:39:11 -0600 |
| commit | 0309a0968564f269b7fb4e00a3c23ce0af3d4cdb (patch) | |
| tree | 470518e98d847b45bdef2a3267f11a243a0f83e8 /spec/integration | |
| parent | 11fecb21ae815a75e4ac0d77af5e682cc2001c65 (diff) | |
Extract url parameter so that it can be generic enough to use in other package managers
Diffstat (limited to 'spec/integration')
| -rw-r--r-- | spec/integration/rubygems/offline_index_spec.rb | 9 |
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 |
