diff options
| -rwxr-xr-x | bin/test-local | 2 | ||||
| -rw-r--r-- | spec/integration/dotnet/examples_spec.rb | 13 | ||||
| -rw-r--r-- | spec/support/integration_test_helper.rb | 4 |
3 files changed, 18 insertions, 1 deletions
diff --git a/bin/test-local b/bin/test-local index 9a84b40..4111eb5 100755 --- a/bin/test-local +++ b/bin/test-local @@ -9,7 +9,7 @@ PROJECT_PATH="$1" if [ -z "$LM_HOME" ]; then export IMAGE_NAME=${IMAGE_NAME:-$(basename "$PWD"):latest} - docker run --rm --volume "$PROJECT_PATH":/code "$IMAGE_NAME" analyze /code + docker run --rm --env LICENSE_FINDER_CLI_OPTS --volume "$PROJECT_PATH":/code "$IMAGE_NAME" analyze /code else bash -l ./run.sh analyze "$PROJECT_PATH" fi diff --git a/spec/integration/dotnet/examples_spec.rb b/spec/integration/dotnet/examples_spec.rb new file mode 100644 index 0000000..43caea0 --- /dev/null +++ b/spec/integration/dotnet/examples_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +RSpec.describe ".NET Core" do + it 'scans https://github.com/microsoft/RockPaperScissorsLizardSpock.git' do + runner.clone('https://github.com/microsoft/RockPaperScissorsLizardSpock.git') + report = runner.scan(env: { 'LICENSE_FINDER_CLI_OPTS' => '--recursive' }) + + expect(report).not_to be_empty + expect(report[:licenses].count).not_to be_zero + expect(report[:dependencies].count).not_to be_zero + end +end + diff --git a/spec/support/integration_test_helper.rb b/spec/support/integration_test_helper.rb index df75176..485af1b 100644 --- a/spec/support/integration_test_helper.rb +++ b/spec/support/integration_test_helper.rb @@ -11,6 +11,10 @@ module IntegrationTestHelper IO.write(full_path, block_given? ? yield : content) end + def clone(repo) + execute({}, "git clone #{repo} #{project_path}") + end + def scan(env: {}) return {} unless execute(env, './bin/test-local', project_path) |
