diff options
Diffstat (limited to 'spec')
29 files changed, 86 insertions, 82 deletions
diff --git a/spec/fixtures/help-build.expected b/spec/fixtures/help-build.expected new file mode 100644 index 0000000..f1c5348 --- /dev/null +++ b/spec/fixtures/help-build.expected @@ -0,0 +1,13 @@ +Usage: + spandx build + +Options: + -h, [--help], [--no-help], [--skip-help] # Display usage information + -d, [--directory=DIRECTORY] # Directory to build index in + # Default: .index + -l, [--logfile=LOGFILE] # Path to a logfile + # Default: /dev/null + -i, [--index=INDEX] # The specific index to build + # Default: all + +Build a package index diff --git a/spec/fixtures/help-pull.expected b/spec/fixtures/help-pull.expected new file mode 100644 index 0000000..5d329f4 --- /dev/null +++ b/spec/fixtures/help-pull.expected @@ -0,0 +1,7 @@ +Usage: + spandx pull + +Options: + -h, [--help], [--no-help], [--skip-help] # Display usage information + +Pull the latest offline cache diff --git a/spec/fixtures/help-scan.expected b/spec/fixtures/help-scan.expected index d1c7f56..ce0279a 100644 --- a/spec/fixtures/help-scan.expected +++ b/spec/fixtures/help-scan.expected @@ -2,14 +2,17 @@ Usage: spandx scan LOCKFILE Options: - -h, [--help], [--no-help] # Display usage information - -R, [--recursive], [--no-recursive] # Perform recursive scan - -a, [--airgap], [--no-airgap] # Disable network connections - -l, [--logfile=LOGFILE] # Path to a logfile - # Default: /dev/null - -f, [--format=FORMAT] # Format of report. (table, csv, json) - # Default: table - -p, [--pull], [--no-pull] # Pull the latest cache before the scan - -r, [--require=REQUIRE] # Causes spandx to load the library using require. + -h, [--help], [--no-help], [--skip-help] # Display usage information + -R, [--recursive], [--no-recursive], [--skip-recursive] # Perform recursive scan + # Default: false + -a, [--airgap], [--no-airgap], [--skip-airgap] # Disable network connections + # Default: false + -l, [--logfile=LOGFILE] # Path to a logfile + # Default: /dev/null + -f, [--format=FORMAT] # Format of report. (table, csv, json) + # Default: table + -p, [--pull], [--no-pull], [--skip-pull] # Pull the latest cache before the scan + # Default: false + -r, [--require=REQUIRE] # Causes spandx to load the library using require. Scan a lockfile and list dependencies/licenses diff --git a/spec/integration/cli/build_spec.rb b/spec/integration/cli/build_spec.rb index 0e51301..47f63a7 100644 --- a/spec/integration/cli/build_spec.rb +++ b/spec/integration/cli/build_spec.rb @@ -3,21 +3,6 @@ RSpec.describe '`spandx build` command', type: :cli do it 'executes `spandx help build` command successfully' do output = `spandx help build` - expected_output = <<~OUT - Usage: - spandx build - - Options: - -h, [--help], [--no-help] # Display usage information - -d, [--directory=DIRECTORY] # Directory to build index in - # Default: .index - -l, [--logfile=LOGFILE] # Path to a logfile - # Default: /dev/null - -i, [--index=INDEX] # The specific index to build - # Default: all - - Build a package index - OUT - expect(output).to eq(expected_output) + expect(output).to eq(fixture_file_content('help-build.expected')) end end diff --git a/spec/integration/cli/pull_spec.rb b/spec/integration/cli/pull_spec.rb index de3426f..f2d396b 100644 --- a/spec/integration/cli/pull_spec.rb +++ b/spec/integration/cli/pull_spec.rb @@ -3,16 +3,6 @@ RSpec.describe '`spandx pull` command', type: :cli do it 'executes `spandx help pull` command successfully' do output = `spandx help pull` - expected_output = <<~OUT - Usage: - spandx pull - - Options: - -h, [--help], [--no-help] # Display usage information - - Pull the latest offline cache - OUT - - expect(output).to eq(expected_output) + expect(output).to eq(fixture_file_content('help-pull.expected')) end end diff --git a/spec/integration/core/git_spec.rb b/spec/integration/core/git_spec.rb index d431dbd..a678269 100644 --- a/spec/integration/core/git_spec.rb +++ b/spec/integration/core/git_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true RSpec.describe Spandx::Core::Git do - subject { described_class.new(url: url) } + subject { described_class.new(url:) } let(:url) { 'https://github.com/spdx/license-list-data.git' } let(:shell) { subject } diff --git a/spec/spandx_spec.rb b/spec/spandx_spec.rb index d54af22..2f76224 100644 --- a/spec/spandx_spec.rb +++ b/spec/spandx_spec.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true RSpec.describe Spandx do - specify { expect(Spandx::VERSION).not_to be nil } + specify { expect(Spandx::VERSION).not_to be_nil } end diff --git a/spec/support/profiler.rb b/spec/support/profiler.rb index 3b8b36b..51da8fb 100644 --- a/spec/support/profiler.rb +++ b/spec/support/profiler.rb @@ -7,7 +7,7 @@ RSpec.configure do |config| def with_profiler(*_args) RubyProf::GraphPrinter .new(RubyProf.profile { yield }) - .print(STDOUT, {}) + .print($stdout, {}) end end) end diff --git a/spec/unit/cli/build_spec.rb b/spec/unit/cli/build_spec.rb index f2c6a1f..f7433fa 100644 --- a/spec/unit/cli/build_spec.rb +++ b/spec/unit/cli/build_spec.rb @@ -21,7 +21,7 @@ RSpec.describe Spandx::Cli::Commands::Build do stub_request(:get, 'https://index.rubygems.org/versions') .to_return(status: 200, body: "created_at: 2020-12-01T00:00:35+00:00\n---\n") - subject.execute(output: output) + subject.execute(output:) expect(output.string).to eq("nuget\nmaven\npypi\nrubygems\nOK\n") end end diff --git a/spec/unit/cli/pull_spec.rb b/spec/unit/cli/pull_spec.rb index dbd284a..b648147 100644 --- a/spec/unit/cli/pull_spec.rb +++ b/spec/unit/cli/pull_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Spandx::Cli::Commands::Pull do let(:output) { StringIO.new } it 'executes `spandx pull` command successfully' do - subject.execute(output: output) + subject.execute(output:) expect(output.string).to eq(fixture_file('pull.expected').read) end diff --git a/spec/unit/cli/scan_spec.rb b/spec/unit/cli/scan_spec.rb index a11842d..a82e296 100644 --- a/spec/unit/cli/scan_spec.rb +++ b/spec/unit/cli/scan_spec.rb @@ -13,7 +13,7 @@ RSpec.describe Spandx::Cli::Commands::Scan do stub_request(:get, Spandx::Spdx::Gateway::URL) .to_return(status: 200, body: fixture_file('spdx/json/licenses.json').read) VCR.use_cassette(lockfile.basename) do - subject.execute(output: output) + subject.execute(output:) end end diff --git a/spec/unit/core/csv_parser_spec.rb b/spec/unit/core/csv_parser_spec.rb index 8aad98f..b474303 100644 --- a/spec/unit/core/csv_parser_spec.rb +++ b/spec/unit/core/csv_parser_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Spandx::Core::CsvParser do describe '.parse' do - let(:subject) { described_class.parse(line) } + subject { described_class.parse(line) } context 'when parsing a single line of csv' do let(:line) { '"spandx","0.0.0","MIT"' + "\n" } diff --git a/spec/unit/core/dependency_spec.rb b/spec/unit/core/dependency_spec.rb index 0aebfe3..d8dd1c3 100644 --- a/spec/unit/core/dependency_spec.rb +++ b/spec/unit/core/dependency_spec.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true RSpec.describe Spandx::Core::Dependency do - subject { described_class.new(name: 'jive', version: '0.1.0', path: path) } + subject { described_class.new(name: 'jive', version: '0.1.0', path:) } let(:path) { Pathname.new('Gemfile.lock') } def build(name, version, path: 'Gemfile.lock') - described_class.new(name: name, version: version, path: Pathname.new(path)) + described_class.new(name:, version:, path: Pathname.new(path)) end describe '#licenses' do @@ -31,7 +31,7 @@ RSpec.describe Spandx::Core::Dependency do end describe '#inspect' do - specify { expect(build('abc', '0.1.0', path: path).inspect).to eql("#<#{described_class} name=abc version=0.1.0 path=#{path}>") } + specify { expect(build('abc', '0.1.0', path:).inspect).to eql("#<#{described_class} name=abc version=0.1.0 path=#{path}>") } end describe '#hash' do diff --git a/spec/unit/core/http_spec.rb b/spec/unit/core/http_spec.rb index 6aeb084..b0158ce 100644 --- a/spec/unit/core/http_spec.rb +++ b/spec/unit/core/http_spec.rb @@ -27,7 +27,7 @@ RSpec.describe ::Spandx::Core::Http do up_url = "https://#{up_host}/#{SecureRandom.uuid}" stub_request(:get, up_url).to_return(status: 200) - expect(subject.get(up_url)).to be_a_kind_of(Net::HTTPSuccess) + expect(subject.get(up_url)).to be_a(Net::HTTPSuccess) end end end diff --git a/spec/unit/core/license_plugin_spec.rb b/spec/unit/core/license_plugin_spec.rb index 19ed0e6..ef00460 100644 --- a/spec/unit/core/license_plugin_spec.rb +++ b/spec/unit/core/license_plugin_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true RSpec.describe Spandx::Core::LicensePlugin do - subject { described_class.new(catalogue: catalogue) } + subject { described_class.new(catalogue:) } let(:catalogue) { ::Spandx::Spdx::Catalogue.from_file(fixture_file('spdx/json/licenses.json')) } @@ -127,7 +127,7 @@ RSpec.describe Spandx::Core::LicensePlugin do { package_manager: :yarn, name: 'utils-merge', version: '1.0.1', expected: ['MIT'] }, { package_manager: :yarn, name: 'vary', version: '1.1.2', expected: ['MIT'] }, ].each do |item| - context "#{item[:package_manager]}-#{item[:name]}-#{item[:version]}" do + context "with #{item[:package_manager]}-#{item[:name]}-#{item[:version]}" do let(:dependency) { ::Spandx::Core::Dependency.new(path: files[item[:package_manager]], name: item[:name], version: item[:version]) } let(:files) do { diff --git a/spec/unit/dotnet/index_spec.rb b/spec/unit/dotnet/index_spec.rb index 2a873de..50e1ed1 100644 --- a/spec/unit/dotnet/index_spec.rb +++ b/spec/unit/dotnet/index_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true RSpec.describe Spandx::Dotnet::Index do - subject { described_class.new(directory: directory, gateway: gateway) } + subject { described_class.new(directory:, gateway:) } let(:gateway) { instance_double(Spandx::Dotnet::NugetGateway) } let(:directory) { Dir.mktmpdir('spandx') } diff --git a/spec/unit/dotnet/parsers/csproj_spec.rb b/spec/unit/dotnet/parsers/csproj_spec.rb index 940b6c8..b0cac3b 100644 --- a/spec/unit/dotnet/parsers/csproj_spec.rb +++ b/spec/unit/dotnet/parsers/csproj_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Spandx::Dotnet::Parsers::Csproj do subject(:described_instance) { described_class.new } def build(name, version, path) - Spandx::Core::Dependency.new(name: name, version: version, path: path) + Spandx::Core::Dependency.new(name:, version:, path:) end describe '#parse' do @@ -15,29 +15,29 @@ RSpec.describe Spandx::Dotnet::Parsers::Csproj do let(:jive) { subject.find { |item| item.name == 'jive' } } - specify { expect(subject).to match_array([build('jive', '0.1.0', file)]) } + it { is_expected.to match_array([build('jive', '0.1.0', file)]) } end context 'when parsing a .csproj file that has a reference to another project' do subject { described_instance.parse(fixture_file('nuget/nested/test.csproj')) } - specify { expect(subject.map(&:name)).to match_array(%w[jive xunit]) } + it { expect(subject.map(&:name)).to match_array(%w[jive xunit]) } end context 'when parsing `Nancy.Hosting.Self.csproj`' do subject { described_instance.parse(fixture_file('nuget/Nancy.Hosting.Self.csproj')) } - specify { expect(subject.count).to be(1) } - specify { expect(subject[0].name).to eql('System.Security.Principal.Windows') } - specify { expect(subject[0].version).to eql('4.3.0') } + it { expect(subject.count).to be(1) } + it { expect(subject[0].name).to eql('System.Security.Principal.Windows') } + it { expect(subject[0].version).to eql('4.3.0') } end end describe '#match?' do - specify { is_expected.to be_match(to_path('/root/Packages.props')) } - specify { is_expected.to be_match(to_path('/root/simple.csproj')) } - specify { is_expected.not_to be_match(to_path('/root/simple.sln')) } - specify { is_expected.to be_match(to_path('C:\Documents and Settings\hello world.csproj')) } - specify { is_expected.to be_match(to_path('C:\Documents and Settings\simple.csproj')) } + it { is_expected.to be_match(to_path('/root/Packages.props')) } + it { is_expected.to be_match(to_path('/root/simple.csproj')) } + it { is_expected.not_to be_match(to_path('/root/simple.sln')) } + it { is_expected.to be_match(to_path('C:\Documents and Settings\hello world.csproj')) } + it { is_expected.to be_match(to_path('C:\Documents and Settings\simple.csproj')) } end end diff --git a/spec/unit/dotnet/parsers/sln_spec.rb b/spec/unit/dotnet/parsers/sln_spec.rb index 50b86d7..0effd8a 100644 --- a/spec/unit/dotnet/parsers/sln_spec.rb +++ b/spec/unit/dotnet/parsers/sln_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Spandx::Dotnet::Parsers::Sln do def build(name, version, path) - Spandx::Core::Dependency.new(name: name, version: version, path: path) + Spandx::Core::Dependency.new(name:, version:, path:) end describe '#parse' do diff --git a/spec/unit/js/parsers/npm_spec.rb b/spec/unit/js/parsers/npm_spec.rb index 37749a5..87484cf 100644 --- a/spec/unit/js/parsers/npm_spec.rb +++ b/spec/unit/js/parsers/npm_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Spandx::Js::Parsers::Npm do let(:expected_dependencies) { fixture_file_content('js/npm/expected').lines.map(&:chomp) } - specify { expect(subject.map { |x| "#{x.name}@#{x.version}" }) .to match_array(expected_dependencies) } + specify { expect(subject.map { |x| "#{x.name}@#{x.version}" }).to match_array(expected_dependencies) } end describe '#match?' do diff --git a/spec/unit/js/parsers/yarn_spec.rb b/spec/unit/js/parsers/yarn_spec.rb index ba6ceed..f623285 100644 --- a/spec/unit/js/parsers/yarn_spec.rb +++ b/spec/unit/js/parsers/yarn_spec.rb @@ -17,7 +17,7 @@ RSpec.describe Spandx::Js::Parsers::Yarn do let(:expected_dependencies) { fixture_file_content('js/yarn/long_yarn.lock.expected').lines.map(&:chomp) } let(:result) { subject.parse(fixture_file('js/yarn/long_yarn.lock')) } - specify { expect(result.map { |x| "#{x.name}@#{x.version}" }) .to match_array(expected_dependencies) } + specify { expect(result.map { |x| "#{x.name}@#{x.version}" }).to match_array(expected_dependencies) } end describe '#match?' do diff --git a/spec/unit/os/parsers/apk_spec.rb b/spec/unit/os/parsers/apk_spec.rb index 0462d1b..220c15f 100644 --- a/spec/unit/os/parsers/apk_spec.rb +++ b/spec/unit/os/parsers/apk_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Spandx::Os::Parsers::Apk do let(:path) { fixture_file('os/lib/apk/db/installed') } def build(name, version, path) - Spandx::Core::Dependency.new(name: name, version: version, path: path) + Spandx::Core::Dependency.new(name:, version:, path:) end specify { expect(subject).to include(build('alpine-baselayout', '3.2.0-r7', path)) } diff --git a/spec/unit/os/parsers/dpkg_spec.rb b/spec/unit/os/parsers/dpkg_spec.rb index df63e35..2832fc9 100644 --- a/spec/unit/os/parsers/dpkg_spec.rb +++ b/spec/unit/os/parsers/dpkg_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Spandx::Os::Parsers::Dpkg do let(:path) { fixture_file('os/var/lib/dpkg/status') } def build(name, version, path) - Spandx::Core::Dependency.new(name: name, version: version, path: path) + Spandx::Core::Dependency.new(name:, version:, path:) end specify { expect(subject).to include(build('adduser', '3.118', path)) } diff --git a/spec/unit/php/parsers/composer_spec.rb b/spec/unit/php/parsers/composer_spec.rb index a97c1af..aaca74b 100644 --- a/spec/unit/php/parsers/composer_spec.rb +++ b/spec/unit/php/parsers/composer_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Spandx::Php::Parsers::Composer do def build(name, version, path) - Spandx::Core::Dependency.new(name: name, version: version, path: path) + Spandx::Core::Dependency.new(name:, version:, path:) end describe '#parse' do diff --git a/spec/unit/python/parsers/pipfile_lock_spec.rb b/spec/unit/python/parsers/pipfile_lock_spec.rb index 59fff52..054ff1d 100644 --- a/spec/unit/python/parsers/pipfile_lock_spec.rb +++ b/spec/unit/python/parsers/pipfile_lock_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Spandx::Python::Parsers::PipfileLock do let(:path) { fixture_file('pip/Pipfile.lock') } def build(name, version, path) - Spandx::Core::Dependency.new(name: name, version: version, path: path) + Spandx::Core::Dependency.new(name:, version:, path:) end specify { expect(subject).to match_array([build('six', '1.13.0', path)]) } diff --git a/spec/unit/python/pypi_spec.rb b/spec/unit/python/pypi_spec.rb index a0617bd..cb350fb 100644 --- a/spec/unit/python/pypi_spec.rb +++ b/spec/unit/python/pypi_spec.rb @@ -141,7 +141,7 @@ RSpec.describe Spandx::Python::Pypi do let(:source) { 'pypi.org' } let(:package) { 'six' } let(:version) { '1.13.0' } - let(:successful_response_body) { JSON.generate(info: { name: package, version: version }) } + let(:successful_response_body) { JSON.generate(info: { name: package, version: }) } context 'when the default source is reachable' do before do diff --git a/spec/unit/ruby/parsers/gemfile_lock_spec.rb b/spec/unit/ruby/parsers/gemfile_lock_spec.rb index ef81112..81d7076 100644 --- a/spec/unit/ruby/parsers/gemfile_lock_spec.rb +++ b/spec/unit/ruby/parsers/gemfile_lock_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Spandx::Ruby::Parsers::GemfileLock do describe '#parse' do def build(name, version, path) - Spandx::Core::Dependency.new(name: name, version: version, path: path) + Spandx::Core::Dependency.new(name:, version:, path:) end context 'when parsing a Gemfile that was BUNDLED_WITH 1.17.3 with a single dependency' do @@ -15,7 +15,7 @@ RSpec.describe Spandx::Ruby::Parsers::GemfileLock do specify { expect(subject[0].meta[:dependencies]).to be_empty } specify { expect(subject[0].meta[:platform]).to eql('ruby') } - specify { expect(subject[0].meta[:source]).to be_a_kind_of(Bundler::Source) } + specify { expect(subject[0].meta[:source]).to be_a(Bundler::Source) } specify { expect(subject).to match_array([build('net-hippie', '0.2.7', path)]) } end @@ -26,7 +26,7 @@ RSpec.describe Spandx::Ruby::Parsers::GemfileLock do specify { expect(subject[0].meta[:dependencies]).to be_empty } specify { expect(subject[0].meta[:platform]).to eql('ruby') } - specify { expect(subject[0].meta[:source]).to be_a_kind_of(Bundler::Source) } + specify { expect(subject[0].meta[:source]).to be_a(Bundler::Source) } specify { expect(subject).to match_array([build('net-hippie', '0.2.7', path)]) } end @@ -37,30 +37,36 @@ RSpec.describe Spandx::Ruby::Parsers::GemfileLock do let(:spandx) { subject.find { |x| x.name == 'spandx' } } specify do - expect(subject.map(&:name)).to match_array([ + expect(subject.map(&:name).uniq).to match_array([ 'addressable', 'ast', + 'base64', + 'benchmark', 'benchmark-ips', 'benchmark-malloc', 'benchmark-perf', 'benchmark-trend', + 'bigdecimal', 'bundler-audit', 'byebug', 'crack', + 'csv', 'diff-lcs', 'dotenv', 'faraday', 'faraday-net_http', 'hashdiff', 'hcl2', + 'json', 'licensed', 'licensee', - 'mini_portile2', - 'multipart-post', + 'logger', 'net-hippie', + 'net-http', 'nokogiri', 'octokit', 'oj', + 'ostruct', 'parallel', 'parser', 'parslet', @@ -86,7 +92,6 @@ RSpec.describe Spandx::Ruby::Parsers::GemfileLock do 'ruby-prof', 'ruby-progressbar', 'ruby-xxHash', - 'ruby2_keywords', 'rugged', 'sawyer', 'set', @@ -98,6 +103,7 @@ RSpec.describe Spandx::Ruby::Parsers::GemfileLock do 'tty-cursor', 'tty-spinner', 'unicode-display_width', + 'uri', 'vcr', 'webmock', 'zeitwerk', @@ -106,7 +112,7 @@ RSpec.describe Spandx::Ruby::Parsers::GemfileLock do specify { expect(subject.map(&:path).uniq).to match_array([path.expand_path]) } specify { expect(spandx.meta[:platform]).to eql('ruby') } - specify { expect(spandx.meta[:source]).to be_a_kind_of(Bundler::Source) } + specify { expect(spandx.meta[:source]).to be_a(Bundler::Source) } end end diff --git a/spec/unit/spdx/composite_license_spec.rb b/spec/unit/spdx/composite_license_spec.rb index 80ee503..d479318 100644 --- a/spec/unit/spdx/composite_license_spec.rb +++ b/spec/unit/spdx/composite_license_spec.rb @@ -11,7 +11,7 @@ RSpec.describe Spandx::Spdx::CompositeLicense do specify { expect(subject.id).to eql('0BSD OR MIT') } specify { expect(subject.name).to eql("#{catalogue['0BSD'].name} OR #{catalogue['MIT'].name}") } - specify { expect(subject).to be_kind_of(::Spandx::Spdx::License) } + specify { expect(subject).to be_a(::Spandx::Spdx::License) } end context 'when parsing an expression with a valid and an invalid license id' do @@ -19,7 +19,7 @@ RSpec.describe Spandx::Spdx::CompositeLicense do specify { expect(subject.id).to eql('MIT OR Nonstandard') } specify { expect(subject.name).to eql("#{catalogue['MIT'].name} OR GPLv3") } - specify { expect(subject).to be_kind_of(::Spandx::Spdx::License) } + specify { expect(subject).to be_a(::Spandx::Spdx::License) } end context 'when parsing a license name' do @@ -40,7 +40,7 @@ RSpec.describe Spandx::Spdx::CompositeLicense do specify { expect(subject.id).to eql('MIT OR CC0-1.0') } specify { expect(subject.name).to eql("#{catalogue['MIT'].name} OR #{catalogue['CC0-1.0'].name}") } - specify { expect(subject).to be_kind_of(::Spandx::Spdx::License) } + specify { expect(subject).to be_a(::Spandx::Spdx::License) } end end end diff --git a/spec/unit/spdx/gateway_spec.rb b/spec/unit/spdx/gateway_spec.rb index cb78a2a..2623934 100644 --- a/spec/unit/spdx/gateway_spec.rb +++ b/spec/unit/spdx/gateway_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Spandx::Spdx::Gateway do describe '#fetch' do - subject { described_class.new.fetch(http: http) } + subject { described_class.new.fetch(http:) } let(:url) { described_class::URL } let(:http) { Spandx::Core::Http.new } diff --git a/spec/unit/terraform/parsers/lock_file_spec.rb b/spec/unit/terraform/parsers/lock_file_spec.rb index 56eecd0..bdfc10c 100644 --- a/spec/unit/terraform/parsers/lock_file_spec.rb +++ b/spec/unit/terraform/parsers/lock_file_spec.rb @@ -11,7 +11,7 @@ RSpec.describe Spandx::Terraform::Parsers::LockFile do describe '#parse' do def build(name, version, path) - Spandx::Core::Dependency.new(name: name, version: version, path: path) + Spandx::Core::Dependency.new(name:, version:, path:) end context 'when parsing a .terraform.lock.hcl file' do |
