summaryrefslogtreecommitdiff
path: root/spec/unit/dotnet
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-04-10 16:34:30 -0600
committermo khan <mo.khan@gmail.com>2020-04-10 16:34:30 -0600
commit6f21aafc85483be2729ff4e95de4d4d7bd71b584 (patch)
treef5dbc5c3464f71d0375c1700c2a663a80517d4f3 /spec/unit/dotnet
parent1e25dc55d843886b06517fa813dc9f65c2777f83 (diff)
Resolve licenses from a central location
Diffstat (limited to 'spec/unit/dotnet')
-rw-r--r--spec/unit/dotnet/parsers/csproj_spec.rb14
-rw-r--r--spec/unit/dotnet/parsers/packages_config_spec.rb7
2 files changed, 3 insertions, 18 deletions
diff --git a/spec/unit/dotnet/parsers/csproj_spec.rb b/spec/unit/dotnet/parsers/csproj_spec.rb
index eb23a6f..f25d194 100644
--- a/spec/unit/dotnet/parsers/csproj_spec.rb
+++ b/spec/unit/dotnet/parsers/csproj_spec.rb
@@ -18,17 +18,12 @@ RSpec.describe Spandx::Dotnet::Parsers::Csproj do
specify { expect(jive.name).to eql('jive') }
specify { expect(jive.version).to eql('0.1.0') }
- specify { expect(jive.licenses.map(&:id)).to match_array(['MIT']) }
end
context 'when parsing a .csproj file that has a reference to another project' do
let(:lockfile) { fixture_file('nuget/nested/test.csproj') }
- let(:because) do
- VCR.use_cassette(File.basename(lockfile)) do
- subject.parse(lockfile)
- end
- end
+ let(:because) { subject.parse(lockfile) }
specify { expect(because.map(&:name)).to match_array(%w[jive xunit]) }
end
@@ -36,16 +31,11 @@ RSpec.describe Spandx::Dotnet::Parsers::Csproj do
context 'when parsing `Nancy.Hosting.Self.csproj`' do
let(:lockfile) { fixture_file('nuget/Nancy.Hosting.Self.csproj') }
- let(:because) do
- VCR.use_cassette(File.basename(lockfile)) do
- subject.parse(lockfile)
- end
- end
+ let(:because) { subject.parse(lockfile) }
specify { expect(because.count).to be(1) }
specify { expect(because[0].name).to eql('System.Security.Principal.Windows') }
specify { expect(because[0].version).to eql('4.3.0') }
- specify { expect(because[0].licenses.map(&:id)).to match_array(['Nonstandard']) }
end
end
diff --git a/spec/unit/dotnet/parsers/packages_config_spec.rb b/spec/unit/dotnet/parsers/packages_config_spec.rb
index cdf885c..761acaf 100644
--- a/spec/unit/dotnet/parsers/packages_config_spec.rb
+++ b/spec/unit/dotnet/parsers/packages_config_spec.rb
@@ -8,16 +8,11 @@ RSpec.describe Spandx::Dotnet::Parsers::PackagesConfig do
describe '#parse' do
context 'when parsing a Gemfile with a single dependency' do
let(:lockfile) { fixture_file('nuget/packages.config') }
- let(:because) do
- VCR.use_cassette(File.basename(lockfile)) do
- subject.parse(lockfile)
- end
- end
+ let(:because) { subject.parse(lockfile) }
let(:nhibernate) { because.find { |item| item.name == 'NHibernate' } }
specify { expect(nhibernate.name).to eql('NHibernate') }
specify { expect(nhibernate.version).to eql('5.2.6') }
- specify { expect(nhibernate.licenses.map(&:id)).to match_array(['LGPL-2.1-only']) }
pending { expect(because.map(&:name)).to include('Antlr3.Runtime') }
pending { expect(because.map(&:name)).to include('Iesi.Collections') }
pending { expect(because.map(&:name)).to include('Remotion.Linq') }