File: dependency_spec.rb

package info (click to toggle)
ruby-solve 4.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,708 kB
  • sloc: ruby: 36,626; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (2)
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
require "spec_helper"

describe Solve::Dependency do
  describe "#initialize" do
    it "uses a default of >= 0.0.0" do
      dep = Solve::Dependency.new(double("artifact"), "ntp")

      expect(dep.constraint.operator).to eq(">=")
      expect(dep.constraint.version.to_s).to eq("0.0.0")
    end
  end

  let(:artifact) { double("artifact") }
  let(:name) { "nginx" }
  let(:constraint) { "~> 0.0.1" }

  subject { Solve::Dependency.new(artifact, name, constraint) }

  describe "#==" do
    it "returns true if the other object is an instance of Solve::Dependency with the same constraint and artifact" do
      other = Solve::Dependency.new(artifact, name, constraint)
      expect(subject).to eq(other)
    end
  end
end