summaryrefslogtreecommitdiff
path: root/spec/integration/python/pipenv_spec.rb
blob: 15e48dcc35354fa90d05eb65f03952f10e396793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'spec_helper'

RSpec.describe "pipenv" do
  context "when a project depends on a Pipfile.lock" do
    let(:pipfile_lock_content) do
      JSON.pretty_generate({
        "_meta": {
          "hash": { "sha256": "" },
          "pipfile-spec": 6,
          "requires": { "python_version": "3.8" },
          "sources": [ { "name": "pypi", "url": "https://pypi.org/simple", "verify_ssl": true } ]
        },
        "default": {
          "six": { "hashes": [], "index": "pypi", "version": "==1.13.0" }
        },
        "develop": {}
      })
    end

    it 'produces a valid report' do
      runner.add_file('Pipfile.lock', pipfile_lock_content)

      report = runner.scan

      expect(report).not_to be_empty
      expect(report[:version]).to start_with('2')
      expect(report[:dependencies].map { |x| x[:name] }).to include("six")
    end
  end
end