summaryrefslogtreecommitdiff
path: root/spec/integration/core
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-05-12 12:56:32 -0600
committermo khan <mo.khan@gmail.com>2020-05-12 12:56:32 -0600
commit09c22f11996144919d016223c07b31bcf1973187 (patch)
tree33975234f28ccbc84c05317000b074dcb498a3f7 /spec/integration/core
parent6d1f3c865f127e67cde5fefba35a8ab0444a5255 (diff)
Move search to IndexFile
Diffstat (limited to 'spec/integration/core')
-rw-r--r--spec/integration/core/data_file_spec.rb18
1 files changed, 11 insertions, 7 deletions
diff --git a/spec/integration/core/data_file_spec.rb b/spec/integration/core/data_file_spec.rb
index 10cb7e9..23ba903 100644
--- a/spec/integration/core/data_file_spec.rb
+++ b/spec/integration/core/data_file_spec.rb
@@ -12,17 +12,21 @@ RSpec.describe Spandx::Core::DataFile do
describe '#search' do
before do
- subject.insert('activemodel', '6.0.2.2', ['MIT'])
+ subject.insert('activemodel', '6.0.2.2', ['Apache-2.0'])
subject.insert('spandx', '0.1.0', ['MIT'])
- subject.insert('zlib', '1.1.0', ['MIT'])
+ subject.insert('zlib', '1.1.0', ['0BSD'])
subject.index.update!
end
- it 'returns the correct result' do
- result = subject.search(name: 'spandx', version: '0.1.0')
-
- expect(result).to match_array(['spandx', '0.1.0', 'MIT'])
- end
+ specify { expect(subject.search(name: '', version: '0.1.0')).to be_nil }
+ specify { expect(subject.search(name: 'activemodel', version: '6.0.2.2')).to match_array(['activemodel', '6.0.2.2', 'Apache-2.0']) }
+ specify { expect(subject.search(name: 'spandx', version: '')).to be_nil }
+ specify { expect(subject.search(name: 'spandx', version: '0.1.0')).to match_array(['spandx', '0.1.0', 'MIT']) }
+ specify { expect(subject.search(name: 'spandx', version: 'unknown')).to be_nil }
+ specify { expect(subject.search(name: 'spandx', version: nil)).to be_nil }
+ specify { expect(subject.search(name: 'unknown', version: '0.1.0')).to be_nil }
+ specify { expect(subject.search(name: 'zlib', version: '1.1.0')).to match_array(['zlib', '1.1.0', '0BSD']) }
+ specify { expect(subject.search(name: nil, version: '0.1.0')).to be_nil }
end
end