diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-01 12:03:47 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-01 12:03:47 -0600 |
| commit | 891e4dda3ec6ab14e6c7ea8d0940667929e94924 (patch) | |
| tree | 6452f1860b9a7460ff3ba4973f9284ce7292955b /spec/integration/core | |
| parent | bf3e0adb8c9b7445bb552f7ad0f858bd62137df4 (diff) | |
Fix linter errors
Diffstat (limited to 'spec/integration/core')
| -rw-r--r-- | spec/integration/core/cache_spec.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/spec/integration/core/cache_spec.rb b/spec/integration/core/cache_spec.rb index 116f3bb..ed426b7 100644 --- a/spec/integration/core/cache_spec.rb +++ b/spec/integration/core/cache_spec.rb @@ -27,7 +27,7 @@ RSpec.describe Spandx::Core::Cache do include_examples 'each data file', 'rubygems', :rubygems include_examples 'each data file', 'nuget', :cache - describe "#insert" do + describe '#insert' do subject { described_class.new('rubygems', root: root_dir) } let(:root_dir) { Dir.mktmpdir } @@ -36,7 +36,7 @@ RSpec.describe Spandx::Core::Cache do FileUtils.remove_entry(root_dir) end - context "when inserting a new record" do + context 'when inserting a new record' do let(:dependency_name) { SecureRandom.uuid } let(:version) { "#{rand(10)}.#{rand(10)}.#{rand(10)}" } @@ -47,7 +47,7 @@ RSpec.describe Spandx::Core::Cache do specify { expect(subject.licenses_for(dependency_name, version)).to match_array(['MIT']) } end - context "when attempting to insert invalid entries" do + context 'when attempting to insert invalid entries' do specify do subject.insert(nil, '1.1.1', ['MIT']) expect(subject.licenses_for(nil, '1.1.1')).to be_empty @@ -61,18 +61,26 @@ RSpec.describe Spandx::Core::Cache do specify do subject.insert('spandx', nil, ['MIT']) expect(subject.licenses_for(nil, '1.1.1')).to be_empty + end + + specify do + subject.insert('spandx', nil, ['MIT']) expect(File.exist?(File.join(root_dir, 'cf'))).to be(false) end specify do subject.insert('spandx', '', ['MIT']) expect(subject.licenses_for('', '1.1.1')).to be_empty + end + + specify do + subject.insert('spandx', '', ['MIT']) expect(File.exist?(File.join(root_dir, 'cf'))).to be(false) end end end - describe "#rebuild_index" do + describe '#rebuild_index' do subject { described_class.new('rubygems', root: root_dir) } let(:root_dir) { Dir.mktmpdir } @@ -81,7 +89,7 @@ RSpec.describe Spandx::Core::Cache do FileUtils.remove_entry(root_dir) end - context "When new items are added to the catalogue" do + context 'when new items are added to the catalogue' do before do subject.insert('spandx', '0.0.0', ['MIT']) subject.insert('bolt', '0.2.0', ['Apache-2.0']) |
