diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/integration/ruby/bundler_spec.rb | 16 | ||||
| -rw-r--r-- | spec/spec_helper.rb | 3 | ||||
| -rw-r--r-- | spec/support/integration_test_helper.rb | 6 | ||||
| -rw-r--r-- | spec/support/matchers.rb | 2 |
4 files changed, 14 insertions, 13 deletions
diff --git a/spec/integration/ruby/bundler_spec.rb b/spec/integration/ruby/bundler_spec.rb index 1f87275..55f3764 100644 --- a/spec/integration/ruby/bundler_spec.rb +++ b/spec/integration/ruby/bundler_spec.rb @@ -123,20 +123,20 @@ RSpec.describe 'bundler' do expect(report).to match_schema(version: '2.0') expect(report[:licenses]).not_to be_empty expect(report.find('net-hippie')).to eql({ - name: 'net-hippie', - description: 'net/http for hippies. ☮️', - url: 'https://github.com/mokhan/net-hippie/', - paths: ['.'], - licenses: ['MIT'] - }) + name: 'net-hippie', + description: 'net/http for hippies. ☮️', + url: 'https://github.com/mokhan/net-hippie/', + paths: ['.'], + licenses: ['MIT'] + }) end end context 'when passing custom options to license finder' do it 'forwards the options to license finder' do report = runner.scan(env: { - 'LICENSE_FINDER_CLI_OPTS' => '--debug --aggregate-paths=. ruby' - }) + 'LICENSE_FINDER_CLI_OPTS' => '--debug --aggregate-paths=. ruby' + }) expect(report).to match_schema(version: '2.0') end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a08aa40..3509c56 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,9 +17,6 @@ RSpec.configure do |config| config.define_derived_metadata(file_path: %r{/spec/integration}) do |metadata| metadata[:type] = :integration end - config.before(:suite) do - system('./bin/docker-build') unless ENV['LM_HOME'] - end config.after(:example, type: :integration) do runner.cleanup end diff --git a/spec/support/integration_test_helper.rb b/spec/support/integration_test_helper.rb index d1ff14a..416438e 100644 --- a/spec/support/integration_test_helper.rb +++ b/spec/support/integration_test_helper.rb @@ -69,7 +69,11 @@ module IntegrationTestHelper end def scan(env: {}) - return {} unless execute(env, './bin/docker-test', project_path) + command = [ + '/usr/local/bin/ruby -I /opt/spandx-gitlab/lib /usr/local/bin/spandx scan --format=json -r spandx/gitlab -R -l /dev/stderr', + project_path + ].join(' ') + return {} unless execute(env, command) report_path = "#{project_path}/gl-license-management-report.json" return {} unless File.exist?(report_path) diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 038c593..937b7cf 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -2,7 +2,7 @@ RSpec::Matchers.define :match_schema do |version: '2.0'| def schema_for(version) - License::Management.root.join("spec/fixtures/schema/v#{version}.json").to_s + Spandx::Gitlab.root.join("spec/fixtures/schema/v#{version}.json").to_s end match do |actual| |
