diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-15 09:52:32 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-15 09:52:32 -0600 |
| commit | cdd4d22c335e6fa1bc8b5155e9104d40ab349753 (patch) | |
| tree | 5df2637e08b154ffe7a84c26c15a1f9765b0fe93 /spec | |
| parent | 7c75bfce48ed6d84bce3cfbbc4644485af02d4f5 (diff) | |
Tidy up code enough so that it can be used to rebuild the index files
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/integration/core/cache_spec.rb | 2 | ||||
| -rw-r--r-- | spec/unit/core/index_file_spec.rb | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/spec/integration/core/cache_spec.rb b/spec/integration/core/cache_spec.rb index ced4604..a021418 100644 --- a/spec/integration/core/cache_spec.rb +++ b/spec/integration/core/cache_spec.rb @@ -116,7 +116,6 @@ RSpec.describe Spandx::Core::Cache do expect(lines).to eql(lines.sort) end - # rubocop:disable RSpec/MultipleExpectations it 'builds an index that contains the seek position for the start of each line' do data_file = subject.datafile_for('spandx') data_file.open_file do |io| @@ -128,7 +127,6 @@ RSpec.describe Spandx::Core::Cache do end end end - # rubocop:enable RSpec/MultipleExpectations specify { expect(subject.licenses_for('bolt', '0.2.0')).to match_array(['Apache-2.0']) } specify { expect(subject.licenses_for('spandx', '0.0.0')).to match_array(['MIT']) } diff --git a/spec/unit/core/index_file_spec.rb b/spec/unit/core/index_file_spec.rb index 280bee4..51aef24 100644 --- a/spec/unit/core/index_file_spec.rb +++ b/spec/unit/core/index_file_spec.rb @@ -21,25 +21,26 @@ RSpec.describe Spandx::Core::IndexFile do specify do subject.scan do |x| - expect(x.row(0)).to eql("\"activemodel\",\"6.0.2.2\",\"Apache-2.0\"\n") + expect(x.row(0)).to eql(['activemodel', '6.0.2.2', 'Apache-2.0']) end end specify do subject.scan do |x| - expect(x.row(1)).to eql("\"spandx\",\"0.1.0\",\"MIT\"\n") + expect(x.row(1)).to eql(['spandx', '0.1.0', 'MIT']) end end specify do subject.scan do |x| - expect(x.row(2)).to eql("\"zlib\",\"1.1.0\",\"0BSD\"\n") + expect(x.row(2)).to eql(['zlib', '1.1.0', '0BSD']) end end end - describe "#update!" do - let(:data_file) { Spandx::Core::DataFile.new('/home/mokha/development/spandx-rubygems/.index/00/rubygems') } + describe '#update!' do + let(:data_file) { Spandx::Core::DataFile.new(path) } + let(:path) { File.expand_path(File.join(Dir.home, '.local', 'share', 'spandx-rubygems', '.index', '00', 'rubygems')) } before do subject.update! |
