summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-11-28 17:59:33 +0000
committermo khan <mo.khan@gmail.com>2019-11-28 17:59:33 +0000
commitdff2bcac25451ceacea5617a32d634d240f483de (patch)
tree7658e53e4cb8dffee346a75152050614cb2a2b48 /spec
parentebffe59af0f1f0ae39c55a9ca837f18e3e418425 (diff)
Delegate to license finder to sort dependencies
* Sort dependencies by name then by version * Log detections
Diffstat (limited to 'spec')
-rw-r--r--spec/license/management/report/v2_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/license/management/report/v2_spec.rb b/spec/license/management/report/v2_spec.rb
index 85c6158..4da973c 100644
--- a/spec/license/management/report/v2_spec.rb
+++ b/spec/license/management/report/v2_spec.rb
@@ -31,7 +31,7 @@ RSpec.describe License::Management::Report::V2 do
subject { described_class.new([dependency]) }
let(:license) { LicenseFinder::License.new(short_name: old_name, matcher: LicenseFinder::License::NoneMatcher.new, url: nil) }
- let(:dependency) { double(name: 'x', summary: '', description: '', homepage: '', licenses: [license]) }
+ let(:dependency) { instance_double(LicenseFinder::Package, name: 'x', summary: '', description: '', homepage: '', licenses: [license]).as_null_object }
let(:result) { subject.to_h }
specify { expect(result[:version]).to eq('2.0') }
@@ -43,7 +43,7 @@ RSpec.describe License::Management::Report::V2 do
context "when choosing an appropriate url for a license" do
subject { described_class.new([dependency]) }
let(:license) { LicenseFinder::License.new(short_name: 'MIT', matcher: LicenseFinder::License::NoneMatcher.new, url: nil) }
- let(:dependency) { double(name: 'x', summary: '', description: '', homepage: '', licenses: [license]) }
+ let(:dependency) { instance_double(LicenseFinder::Package, name: 'x', summary: '', description: '', homepage: '', licenses: [license]).as_null_object }
specify { expect(subject.to_h[:licenses][0]['url']).to eql('https://opensource.org/licenses/MIT') }
end