Package: ruby-dep-selector / 1.0.3-2

0004-Make-it-solve-2.0-compatible.patch Patch series | download
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From: Hleb Valoshka <375gnu@gmail.com>
Date: Thu, 25 Jun 2015 21:13:11 +0300
Subject: Make it solve 2.0 compatible

---
 spec/solve_integration_spec.rb | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/spec/solve_integration_spec.rb b/spec/solve_integration_spec.rb
index eeac5b2..0cb7553 100644
--- a/spec/solve_integration_spec.rb
+++ b/spec/solve_integration_spec.rb
@@ -1,16 +1,6 @@
 require 'spec_helper'
 require 'solve'
-
-# The current version of solve (0.8.2) doesn't quite match the API we require.
-# This will be remedied in a future release.
-module Solve
-  class Constraint
-
-    def include?(v)
-      satisfies?(v)
-    end
-  end
-end
+require 'solve/constraint'
 
 # Test that we can use duck typing to pass Solve's version and constraint
 # types to dep-selector
@@ -19,10 +9,10 @@ describe "Integration with berkshelf solve" do
   let(:solve_graph) do
     graph = Solve::Graph.new
 
-    graph.artifacts("top-level", "1.0.0")
+    graph.artifact("top-level", "1.0.0")
       .depends("dep-package", ">= 0.0.0")
 
-    graph.artifacts("dep-package", "1.0.0-beta")
+    graph.artifact("dep-package", "1.0.0-beta")
     graph
   end
 
@@ -30,14 +20,14 @@ describe "Integration with berkshelf solve" do
 
   let(:graph) { DepSelector::DependencyGraph.new }
 
-  let(:solve_artifact_top_level) { solve_graph.artifacts("top-level", "1.0.0") }
-  let(:solve_artifact_dep_package) { solve_graph.artifacts("dep-package", "1.0.0") }
+  let(:solve_artifact_top_level) { solve_graph.artifact("top-level", "1.0.0") }
+  let(:solve_artifact_dep_package) { solve_graph.artifact("dep-package", "1.0.0") }
 
   it "uses solve's artifact objects to describe the problem" do
     artifact = solve_artifact_top_level
 
     package_version = graph.package(artifact.name).add_version(artifact.version)
-    package_version.version.should == Solve::Version.new("1.0.0")
+    package_version.version.should == Semverse::Version.new("1.0.0")
   end
 
   it "uses solve's constraints to find matching packages" do
@@ -63,7 +53,7 @@ describe "Integration with berkshelf solve" do
 
     selector = DepSelector::Selector.new(graph, (1.0))
     solution = selector.find_solution(gecode_demands, gecode_all_versions)
-    solution.should == { "top-level" => Solve::Version.new("1.0.0") }
+    solution.should == { "top-level" => Semverse::Version.new("1.0.0") }
   end
 
 end