summaryrefslogtreecommitdiff
path: root/spec/unit/core
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-05-15 09:52:32 -0600
committermo khan <mo.khan@gmail.com>2020-05-15 09:52:32 -0600
commitcdd4d22c335e6fa1bc8b5155e9104d40ab349753 (patch)
tree5df2637e08b154ffe7a84c26c15a1f9765b0fe93 /spec/unit/core
parent7c75bfce48ed6d84bce3cfbbc4644485af02d4f5 (diff)
Tidy up code enough so that it can be used to rebuild the index files
Diffstat (limited to 'spec/unit/core')
-rw-r--r--spec/unit/core/index_file_spec.rb11
1 files changed, 6 insertions, 5 deletions
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!