diff options
| author | mo khan <mo.khan@gmail.com> | 2020-04-13 10:49:11 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-04-13 10:49:11 -0600 |
| commit | 44c0d2b75ea2c815d86c5c211410cb1e0a2a498f (patch) | |
| tree | 5bd11175d7772aced3bdc5051057071c2e855470 /spec | |
| parent | 6a901f291714ec319e9cd027d12aa5f42b12a9dd (diff) | |
Extract singletons for git dbs
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/fixtures/js/yarn/long_yarn.lock.expected (renamed from spec/fixtures/js/yarn/lol) | 0 | ||||
| -rw-r--r-- | spec/integration/core/cache_spec.rb | 8 | ||||
| -rw-r--r-- | spec/unit/js/parsers/yarn_spec.rb | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/spec/fixtures/js/yarn/lol b/spec/fixtures/js/yarn/long_yarn.lock.expected index 2208afc..2208afc 100644 --- a/spec/fixtures/js/yarn/lol +++ b/spec/fixtures/js/yarn/long_yarn.lock.expected diff --git a/spec/integration/core/cache_spec.rb b/spec/integration/core/cache_spec.rb index db8def2..8f56c55 100644 --- a/spec/integration/core/cache_spec.rb +++ b/spec/integration/core/cache_spec.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true RSpec.describe Spandx::Core::Cache do - RSpec.shared_examples 'each data file' do |package_manager, url| + RSpec.shared_examples 'each data file' do |package_manager, key| describe "#licenses_for (#{package_manager})" do - subject { described_class.new(package_manager, url: url) } + subject { described_class.new(package_manager, db: Spandx.git[key]) } (0x00..0xFF).map { |x| x.to_s(16).upcase.rjust(2, '0').downcase }.each do |hex| context hex do @@ -24,6 +24,6 @@ RSpec.describe Spandx::Core::Cache do end end - include_examples 'each data file', 'rubygems', 'https://github.com/mokhan/spandx-rubygems.git' - include_examples 'each data file', 'nuget', 'https://github.com/mokhan/spandx-index.git' + include_examples 'each data file', 'rubygems', :rubygems + include_examples 'each data file', 'nuget', :cache end diff --git a/spec/unit/js/parsers/yarn_spec.rb b/spec/unit/js/parsers/yarn_spec.rb index 93e8eb5..4e1fdb2 100644 --- a/spec/unit/js/parsers/yarn_spec.rb +++ b/spec/unit/js/parsers/yarn_spec.rb @@ -20,7 +20,7 @@ RSpec.describe Spandx::Js::Parsers::Yarn do describe '#parse long lock file' do let(:lockfile) { fixture_file('js/yarn/long_yarn.lock') } - let(:expected_dependencies) { fixture_file_content('js/yarn/lol').lines.map(&:chomp) } + let(:expected_dependencies) { fixture_file_content('js/yarn/long_yarn.lock.expected').lines.map(&:chomp) } let(:result) { subject.parse(lockfile) } specify { expect(result.map { |x| "#{x.name}@#{x.version}" }) .to match_array(expected_dependencies) } |
