diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-12 16:47:28 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-12 16:47:28 -0600 |
| commit | a32acb798b8fc5e3349fc49118f05b060a48ae43 (patch) | |
| tree | 0778249d938862157fc89dc2c886181c6bca776c /spec/unit/core | |
| parent | 09c22f11996144919d016223c07b31bcf1973187 (diff) | |
play with pointers
Diffstat (limited to 'spec/unit/core')
| -rw-r--r-- | spec/unit/core/csv_parser_spec.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/unit/core/csv_parser_spec.rb b/spec/unit/core/csv_parser_spec.rb index 01909aa..84edad7 100644 --- a/spec/unit/core/csv_parser_spec.rb +++ b/spec/unit/core/csv_parser_spec.rb @@ -16,10 +16,28 @@ RSpec.describe Spandx::Core::CsvParser do specify { expect(subject).to eql(['spa,ndx', '0.0.0', 'MIT']) } end - context 'when parsing a line of csv that contains empty value' do + context 'when parsing a line of csv that contains empty name' do + let(:line) { '"","0.0.0","MIT"' } + + specify { expect(subject).to eql(['', '0.0.0', 'MIT']) } + end + + context 'when parsing a line of csv that contains empty version' do + let(:line) { '"AWSSDK.Organizations","","MIT"' } + + specify { expect(subject).to eql(['AWSSDK.Organizations', '', 'MIT']) } + end + + context 'when parsing a line of csv that contains empty license' do let(:line) { '"AWSSDK.Organizations","3.3.8.12",""' } specify { expect(subject).to eql(['AWSSDK.Organizations', '3.3.8.12', '']) } end + + context 'when parsing an invalid line of csv' do + specify { expect(described_class.parse('invalid","3.3.8.12",""')).to be_nil } + specify { expect(described_class.parse('"hello O\"world","0.1.0"')).to be_nil } + specify { expect(described_class.parse('"hello O\"world","0.1.0",""')).to be_nil } + end end end |
