diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-06 11:33:16 -0700 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-03-06 11:33:16 -0700 |
| commit | b4abeb395762cd0370aed4f614aa224db5c15f22 (patch) | |
| tree | 255d4d0331cb9ff6f6cb8d8fdbda3e7a757d37ca /spec/support | |
| parent | 06cf54374ff826b0fec62bb50e52a38e46c8a81d (diff) | |
fix some pip specs
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/integration_test_helper.rb | 7 | ||||
| -rw-r--r-- | spec/support/shared.rb | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/spec/support/integration_test_helper.rb b/spec/support/integration_test_helper.rb index 737e988..9ecc8aa 100644 --- a/spec/support/integration_test_helper.rb +++ b/spec/support/integration_test_helper.rb @@ -14,7 +14,10 @@ module IntegrationTestHelper end def clone(repo, branch: 'master') - execute({}, "git clone -b #{branch} #{repo} #{project_path}") + execute({}, "git", "clone", repo, project_path) + Dir.chdir project_path do + execute({}, "git", "checkout", branch) + end end def scan(env: {}) @@ -28,7 +31,7 @@ module IntegrationTestHelper def execute(env = {}, *args) Bundler.with_clean_env do - system(env, *args) + system(env, *args, exception: true) end end diff --git a/spec/support/shared.rb b/spec/support/shared.rb index 9bfd690..8a7590b 100644 --- a/spec/support/shared.rb +++ b/spec/support/shared.rb @@ -7,8 +7,8 @@ RSpec.shared_examples "each report version" do |language, package_manager, branc runner.clone(url, branch: branch) report = runner.scan(env: { 'LM_REPORT_VERSION' => version }) - expected = JSON.parse(fixture_file_content("expected/#{language}/#{package_manager}/v#{version}.json"), symbolize_names: true) - expect(report).to eq(expected) + content = fixture_file_content("expected/#{language}/#{package_manager}/v#{version}.json") + expect(report).to eq(JSON.parse(content, symbolize_names: true)) expect(report).to match_schema(version: version) end end |
