librarian-puppet 0.9.10 → 0.9.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +82 -19
  3. data/bin/librarian-puppet +0 -2
  4. data/lib/librarian/puppet.rb +32 -4
  5. data/lib/librarian/puppet/cli.rb +7 -0
  6. data/lib/librarian/puppet/dsl.rb +13 -0
  7. data/lib/librarian/puppet/environment.rb +5 -8
  8. data/lib/librarian/puppet/extension.rb +212 -0
  9. data/lib/librarian/puppet/requirement.rb +6 -2
  10. data/lib/librarian/puppet/source.rb +1 -0
  11. data/lib/librarian/puppet/source/forge.rb +62 -35
  12. data/lib/librarian/puppet/source/git.rb +51 -36
  13. data/lib/librarian/puppet/source/githubtarball.rb +44 -28
  14. data/lib/librarian/puppet/source/local.rb +4 -1
  15. data/lib/librarian/puppet/templates/Puppetfile +3 -0
  16. data/lib/librarian/puppet/util.rb +27 -0
  17. data/lib/librarian/puppet/version.rb +1 -1
  18. metadata +106 -207
  19. data/vendor/librarian/CHANGELOG.md +0 -185
  20. data/vendor/librarian/Gemfile +0 -6
  21. data/vendor/librarian/MIT-LICENSE +0 -20
  22. data/vendor/librarian/README.md +0 -403
  23. data/vendor/librarian/Rakefile +0 -34
  24. data/vendor/librarian/bin/librarian-chef +0 -7
  25. data/vendor/librarian/bin/librarian-mock +0 -7
  26. data/vendor/librarian/config/cucumber.yaml +0 -1
  27. data/vendor/librarian/features/chef/cli/init.feature +0 -11
  28. data/vendor/librarian/features/chef/cli/install.feature +0 -64
  29. data/vendor/librarian/features/chef/cli/show.feature +0 -77
  30. data/vendor/librarian/features/chef/cli/version.feature +0 -11
  31. data/vendor/librarian/features/support/env.rb +0 -9
  32. data/vendor/librarian/lib/librarian.rb +0 -19
  33. data/vendor/librarian/lib/librarian/action.rb +0 -5
  34. data/vendor/librarian/lib/librarian/action/base.rb +0 -24
  35. data/vendor/librarian/lib/librarian/action/clean.rb +0 -44
  36. data/vendor/librarian/lib/librarian/action/ensure.rb +0 -24
  37. data/vendor/librarian/lib/librarian/action/install.rb +0 -99
  38. data/vendor/librarian/lib/librarian/action/resolve.rb +0 -81
  39. data/vendor/librarian/lib/librarian/action/update.rb +0 -78
  40. data/vendor/librarian/lib/librarian/chef.rb +0 -1
  41. data/vendor/librarian/lib/librarian/chef/cli.rb +0 -48
  42. data/vendor/librarian/lib/librarian/chef/dsl.rb +0 -15
  43. data/vendor/librarian/lib/librarian/chef/environment.rb +0 -27
  44. data/vendor/librarian/lib/librarian/chef/extension.rb +0 -9
  45. data/vendor/librarian/lib/librarian/chef/integration/knife.rb +0 -42
  46. data/vendor/librarian/lib/librarian/chef/manifest_reader.rb +0 -59
  47. data/vendor/librarian/lib/librarian/chef/source.rb +0 -3
  48. data/vendor/librarian/lib/librarian/chef/source/git.rb +0 -25
  49. data/vendor/librarian/lib/librarian/chef/source/local.rb +0 -69
  50. data/vendor/librarian/lib/librarian/chef/source/path.rb +0 -12
  51. data/vendor/librarian/lib/librarian/chef/source/site.rb +0 -452
  52. data/vendor/librarian/lib/librarian/chef/templates/Cheffile +0 -15
  53. data/vendor/librarian/lib/librarian/cli.rb +0 -205
  54. data/vendor/librarian/lib/librarian/cli/manifest_presenter.rb +0 -79
  55. data/vendor/librarian/lib/librarian/config.rb +0 -7
  56. data/vendor/librarian/lib/librarian/config/database.rb +0 -205
  57. data/vendor/librarian/lib/librarian/config/file_source.rb +0 -47
  58. data/vendor/librarian/lib/librarian/config/hash_source.rb +0 -33
  59. data/vendor/librarian/lib/librarian/config/source.rb +0 -149
  60. data/vendor/librarian/lib/librarian/dependency.rb +0 -91
  61. data/vendor/librarian/lib/librarian/dsl.rb +0 -108
  62. data/vendor/librarian/lib/librarian/dsl/receiver.rb +0 -48
  63. data/vendor/librarian/lib/librarian/dsl/target.rb +0 -172
  64. data/vendor/librarian/lib/librarian/environment.rb +0 -134
  65. data/vendor/librarian/lib/librarian/error.rb +0 -4
  66. data/vendor/librarian/lib/librarian/helpers.rb +0 -13
  67. data/vendor/librarian/lib/librarian/lockfile.rb +0 -29
  68. data/vendor/librarian/lib/librarian/lockfile/compiler.rb +0 -66
  69. data/vendor/librarian/lib/librarian/lockfile/parser.rb +0 -100
  70. data/vendor/librarian/lib/librarian/logger.rb +0 -46
  71. data/vendor/librarian/lib/librarian/manifest.rb +0 -234
  72. data/vendor/librarian/lib/librarian/manifest_set.rb +0 -153
  73. data/vendor/librarian/lib/librarian/mock.rb +0 -1
  74. data/vendor/librarian/lib/librarian/mock/cli.rb +0 -19
  75. data/vendor/librarian/lib/librarian/mock/dsl.rb +0 -15
  76. data/vendor/librarian/lib/librarian/mock/environment.rb +0 -24
  77. data/vendor/librarian/lib/librarian/mock/extension.rb +0 -9
  78. data/vendor/librarian/lib/librarian/mock/source.rb +0 -1
  79. data/vendor/librarian/lib/librarian/mock/source/mock.rb +0 -103
  80. data/vendor/librarian/lib/librarian/mock/source/mock/registry.rb +0 -83
  81. data/vendor/librarian/lib/librarian/resolution.rb +0 -44
  82. data/vendor/librarian/lib/librarian/resolver.rb +0 -78
  83. data/vendor/librarian/lib/librarian/resolver/implementation.rb +0 -118
  84. data/vendor/librarian/lib/librarian/source.rb +0 -2
  85. data/vendor/librarian/lib/librarian/source/git.rb +0 -156
  86. data/vendor/librarian/lib/librarian/source/git/repository.rb +0 -217
  87. data/vendor/librarian/lib/librarian/source/local.rb +0 -61
  88. data/vendor/librarian/lib/librarian/source/path.rb +0 -80
  89. data/vendor/librarian/lib/librarian/spec.rb +0 -13
  90. data/vendor/librarian/lib/librarian/spec_change_set.rb +0 -173
  91. data/vendor/librarian/lib/librarian/specfile.rb +0 -18
  92. data/vendor/librarian/lib/librarian/support/abstract_method.rb +0 -21
  93. data/vendor/librarian/lib/librarian/ui.rb +0 -64
  94. data/vendor/librarian/lib/librarian/version.rb +0 -3
  95. data/vendor/librarian/librarian.gemspec +0 -34
  96. data/vendor/librarian/spec/functional/chef/source/git_spec.rb +0 -432
  97. data/vendor/librarian/spec/functional/chef/source/site_spec.rb +0 -215
  98. data/vendor/librarian/spec/functional/source/git/repository_spec.rb +0 -149
  99. data/vendor/librarian/spec/unit/action/base_spec.rb +0 -18
  100. data/vendor/librarian/spec/unit/action/clean_spec.rb +0 -102
  101. data/vendor/librarian/spec/unit/action/ensure_spec.rb +0 -37
  102. data/vendor/librarian/spec/unit/action/install_spec.rb +0 -111
  103. data/vendor/librarian/spec/unit/config/database_spec.rb +0 -319
  104. data/vendor/librarian/spec/unit/dependency_spec.rb +0 -36
  105. data/vendor/librarian/spec/unit/dsl_spec.rb +0 -194
  106. data/vendor/librarian/spec/unit/environment_spec.rb +0 -9
  107. data/vendor/librarian/spec/unit/lockfile/parser_spec.rb +0 -162
  108. data/vendor/librarian/spec/unit/lockfile_spec.rb +0 -65
  109. data/vendor/librarian/spec/unit/manifest_set_spec.rb +0 -202
  110. data/vendor/librarian/spec/unit/manifest_spec.rb +0 -36
  111. data/vendor/librarian/spec/unit/manifest_version_spec.rb +0 -94
  112. data/vendor/librarian/spec/unit/mock/source/mock_spec.rb +0 -22
  113. data/vendor/librarian/spec/unit/resolver_spec.rb +0 -192
  114. data/vendor/librarian/spec/unit/source/git_spec.rb +0 -29
  115. data/vendor/librarian/spec/unit/spec_change_set_spec.rb +0 -169
@@ -1,202 +0,0 @@
1
- require 'librarian'
2
-
3
- module Librarian
4
- describe ManifestSet do
5
-
6
- describe ".new" do
7
- let(:jelly) { double(:name => "jelly") }
8
- let(:butter) { double(:name => "butter") }
9
- let(:jam) { double(:name => "jam") }
10
-
11
- let(:array) { [jelly, butter, jam] }
12
- let(:hash) { {"jelly" => jelly, "butter" => butter, "jam" => jam} }
13
-
14
- context "with an array" do
15
- let(:set) { described_class.new(array) }
16
-
17
- it "should give back the array" do
18
- set.to_a.should =~ array
19
- end
20
-
21
- it "should give back the hash" do
22
- set.to_hash.should == hash
23
- end
24
- end
25
-
26
- context "with a hash" do
27
- let(:set) { described_class.new(hash) }
28
-
29
- it "should give back the array" do
30
- set.to_a.should =~ array
31
- end
32
-
33
- it "should give back the hash" do
34
- set.to_hash.should == hash
35
- end
36
- end
37
- end
38
-
39
- # Does not trace dependencies.
40
- # That's why it's "shallow".
41
- describe "#shallow_strip!" do
42
- let(:jelly) { double(:name => "jelly") }
43
- let(:butter) { double(:name => "butter") }
44
- let(:jam) { double(:name => "jam") }
45
-
46
- let(:set) { described_class.new([jelly, butter, jam]) }
47
-
48
- it "should not do anything when given no names" do
49
- set.shallow_strip!([])
50
-
51
- set.to_a.should =~ [jelly, butter, jam]
52
- end
53
-
54
- it "should remove only the named elements" do
55
- set.shallow_strip!(["butter", "jam"])
56
-
57
- set.to_a.should =~ [jelly]
58
- end
59
-
60
- it "should allow removing all the elements" do
61
- set.shallow_strip!(["jelly", "butter", "jam"])
62
-
63
- set.to_a.should =~ []
64
- end
65
- end
66
-
67
- # Does not trace dependencies.
68
- # That's why it's "shallow".
69
- describe "#shallow_keep!" do
70
- let(:jelly) { double(:name => "jelly") }
71
- let(:butter) { double(:name => "butter") }
72
- let(:jam) { double(:name => "jam") }
73
-
74
- let(:set) { described_class.new([jelly, butter, jam]) }
75
-
76
- it "should empty the set when given no names" do
77
- set.shallow_keep!([])
78
-
79
- set.to_a.should =~ []
80
- end
81
-
82
- it "should keep only the named elements" do
83
- set.shallow_keep!(["butter", "jam"])
84
-
85
- set.to_a.should =~ [butter, jam]
86
- end
87
-
88
- it "should allow keeping all the elements" do
89
- set.shallow_keep!(["jelly", "butter", "jam"])
90
-
91
- set.to_a.should =~ [jelly, butter, jam]
92
- end
93
- end
94
-
95
- describe "#deep_strip!" do
96
- def man(o)
97
- k, v = o.keys.first, o.values.first
98
- double(k, :name => k, :dependencies => deps(v))
99
- end
100
-
101
- def deps(names)
102
- names.map{|n| double(:name => n)}
103
- end
104
-
105
- let(:a) { man("a" => %w[b c]) }
106
- let(:b) { man("b" => %w[c d]) }
107
- let(:c) { man("c" => %w[ ]) }
108
- let(:d) { man("d" => %w[ ]) }
109
-
110
- let(:e) { man("e" => %w[f g]) }
111
- let(:f) { man("f" => %w[g h]) }
112
- let(:g) { man("g" => %w[ ]) }
113
- let(:h) { man("h" => %w[ ]) }
114
-
115
- let(:set) { described_class.new([a, b, c, d, e, f, g, h]) }
116
-
117
- it "should not do anything when given no names" do
118
- set.deep_strip!([])
119
-
120
- set.to_a.should =~ [a, b, c, d, e, f, g, h]
121
- end
122
-
123
- it "should remove just the named elements if they have no dependencies" do
124
- set.deep_strip!(["c", "h"])
125
-
126
- set.to_a.should =~ [a, b, d, e, f, g]
127
- end
128
-
129
- it "should remove the named elements and all their dependencies" do
130
- set.deep_strip!(["b"])
131
-
132
- set.to_a.should =~ [a, e, f, g, h]
133
- end
134
-
135
- it "should remove an entire tree of dependencies" do
136
- set.deep_strip!(["e"])
137
-
138
- set.to_a.should =~ [a, b, c, d]
139
- end
140
-
141
- it "should allow removing all the elements" do
142
- set.deep_strip!(["a", "e"])
143
-
144
- set.to_a.should =~ []
145
- end
146
- end
147
-
148
- describe "#deep_keep!" do
149
- def man(o)
150
- k, v = o.keys.first, o.values.first
151
- double(k, :name => k, :dependencies => deps(v))
152
- end
153
-
154
- def deps(names)
155
- names.map{|n| double(:name => n)}
156
- end
157
-
158
- let(:a) { man("a" => %w[b c]) }
159
- let(:b) { man("b" => %w[c d]) }
160
- let(:c) { man("c" => %w[ ]) }
161
- let(:d) { man("d" => %w[ ]) }
162
-
163
- let(:e) { man("e" => %w[f g]) }
164
- let(:f) { man("f" => %w[g h]) }
165
- let(:g) { man("g" => %w[ ]) }
166
- let(:h) { man("h" => %w[ ]) }
167
-
168
- let(:set) { described_class.new([a, b, c, d, e, f, g, h]) }
169
-
170
- it "should remove all the elements when given no names" do
171
- set.deep_keep!([])
172
-
173
- set.to_a.should =~ []
174
- end
175
-
176
- it "should keep just the named elements if they have no dependencies" do
177
- set.deep_keep!(["c", "h"])
178
-
179
- set.to_a.should =~ [c, h]
180
- end
181
-
182
- it "should keep the named elements and all their dependencies" do
183
- set.deep_keep!(["b"])
184
-
185
- set.to_a.should =~ [b, c, d]
186
- end
187
-
188
- it "should keep an entire tree of dependencies" do
189
- set.deep_keep!(["e"])
190
-
191
- set.to_a.should =~ [e, f, g, h]
192
- end
193
-
194
- it "should allow keeping all the elements" do
195
- set.deep_keep!(["a", "e"])
196
-
197
- set.to_a.should =~ [a, b, c, d, e, f, g, h]
198
- end
199
- end
200
-
201
- end
202
- end
@@ -1,36 +0,0 @@
1
- require "librarian/manifest"
2
-
3
- describe Librarian::Manifest do
4
-
5
- describe "validations" do
6
-
7
- context "when the name is blank" do
8
- it "raises" do
9
- expect { described_class.new(nil, "") }.
10
- to raise_error(ArgumentError, %{name ("") must be sensible})
11
- end
12
- end
13
-
14
- context "when the name has leading whitespace" do
15
- it "raises" do
16
- expect { described_class.new(nil, " the-name") }.
17
- to raise_error(ArgumentError, %{name (" the-name") must be sensible})
18
- end
19
- end
20
-
21
- context "when the name has trailing whitespace" do
22
- it "raises" do
23
- expect { described_class.new(nil, "the-name ") }.
24
- to raise_error(ArgumentError, %{name ("the-name ") must be sensible})
25
- end
26
- end
27
-
28
- context "when the name is a single character" do
29
- it "passes" do
30
- described_class.new(nil, "R")
31
- end
32
- end
33
-
34
- end
35
-
36
- end
@@ -1,94 +0,0 @@
1
- require "librarian/manifest"
2
-
3
- describe Librarian::Manifest::Version do
4
-
5
- describe "version comparison" do
6
-
7
- context "when version has only two components" do
8
- it "creates a new version with only 2 version components" do
9
- v1 = described_class.new("1.0")
10
- end
11
- end
12
-
13
- context "when neither version has pre-release items" do
14
- it "compares 1.0.0 < 2.0.0" do
15
- v1 = described_class.new("1.0.0")
16
- v2 = described_class.new("2.0.0")
17
- expect(v1 <=> v2).to eq(-1)
18
- end
19
- it "compares 2.0.0 < 2.1.0" do
20
- v1 = described_class.new("2.0.0")
21
- v2 = described_class.new("2.1.0")
22
- expect(v1 <=> v2).to eq(-1)
23
- end
24
- it "compares 2.1.0 < 2.1.1" do
25
- v1 = described_class.new("2.1.0")
26
- v2 = described_class.new("2.1.1")
27
- expect(v1 <=> v2).to eq(-1)
28
- end
29
- end
30
-
31
- context "when versions have pre-release information" do
32
- it "compares 1.0.0-alpha < 1.0.0-alpha1" do
33
- v1 = described_class.new("1.0.0-alpha")
34
- v2 = described_class.new("1.0.0-alpha.1")
35
- expect(v1 <=> v2).to eq(-1)
36
- end
37
- it "compares 1.0.0-alpha.1 < 1.0.0-alpha.beta" do
38
- v1 = described_class.new("1.0.0-alpha.1")
39
- v2 = described_class.new("1.0.0-alpha.beta")
40
- expect(v1 <=> v2).to eq(-1)
41
- end
42
- it "compares 1.0.0-alpha.beta < 1.0.0-beta" do
43
- v1 = described_class.new("1.0.0-alpha.beta")
44
- v2 = described_class.new("1.0.0-beta")
45
- expect(v1 <=> v2).to eq(-1)
46
- end
47
- it "compares 1.0.0-beta < 1.0.0-beta.2" do
48
- v1 = described_class.new("1.0.0-beta")
49
- v2 = described_class.new("1.0.0-beta.2")
50
- expect(v1 <=> v2).to eq(-1)
51
- end
52
- it "compares 1.0.0-beta.2 < 1.0.0-beta.11" do
53
- v1 = described_class.new("1.0.0-beta.2")
54
- v2 = described_class.new("1.0.0-beta.11")
55
- expect(v1 <=> v2).to eq(-1)
56
- end
57
- it "compares 1.0.0-beta.11 < 1.0.0-rc.1" do
58
- v1 = described_class.new("1.0.0-beta.11")
59
- v2 = described_class.new("1.0.0-rc.1")
60
- expect(v1 <=> v2).to eq(-1)
61
- end
62
- it "compares 1.0.0-rc.1 < 1.0.0" do
63
- v1 = described_class.new("1.0.0-rc.1")
64
- v2 = described_class.new("1.0.0")
65
- expect(v1 <=> v2).to eq(-1)
66
- end
67
- end
68
-
69
- context "when an invalid version number is provided" do
70
- it "raises" do
71
- expect { described_class.new("invalidversion") }.
72
- to raise_error(ArgumentError)
73
- end
74
- end
75
-
76
- context "when a version is converted to string" do
77
- it "should be the full semver" do
78
- version = "1.0.0-beta.11+200.1.2"
79
- v1 = described_class.new(version)
80
- expect(v1.to_s).to eq(version)
81
- end
82
- it "should be the full gem version" do
83
- version = "1.0.0.a"
84
- v1 = described_class.new(version)
85
- expect(v1.to_s).to eq(version)
86
- end
87
- it "should be the two-component version" do
88
- version = "1.0"
89
- v1 = described_class.new(version)
90
- expect(v1.to_s).to eq(version)
91
- end
92
- end
93
- end
94
- end
@@ -1,22 +0,0 @@
1
- require "librarian/mock"
2
-
3
- module Librarian
4
- module Mock
5
- module Source
6
- describe Mock do
7
-
8
- let(:env) { Librarian::Mock::Environment.new }
9
-
10
- describe ".new" do
11
-
12
- let(:source) { described_class.new(env, "source-a", {}) }
13
- subject { source }
14
-
15
- its(:environment) { should_not be_nil }
16
-
17
- end
18
-
19
- end
20
- end
21
- end
22
- end
@@ -1,192 +0,0 @@
1
- require 'librarian/resolver'
2
- require 'librarian/spec_change_set'
3
- require 'librarian/mock'
4
-
5
- module Librarian
6
- describe Resolver do
7
-
8
- let(:env) { Mock::Environment.new }
9
- let(:resolver) { env.resolver }
10
-
11
- context "a simple specfile" do
12
-
13
- before do
14
- env.registry :clear => true do
15
- source 'source-1' do
16
- spec 'butter', '1.1'
17
- end
18
- end
19
- end
20
-
21
- let(:spec) do
22
- env.dsl do
23
- src 'source-1'
24
- dep 'butter'
25
- end
26
- end
27
-
28
- let(:resolution) { resolver.resolve(spec) }
29
-
30
- specify { resolution.should be_correct }
31
-
32
- end
33
-
34
- context "a specfile with a dep from one src depending on a dep from another src" do
35
-
36
- before do
37
- env.registry :clear => true do
38
- source 'source-1' do
39
- spec 'butter', '1.1'
40
- end
41
- source 'source-2' do
42
- spec 'jam', '1.2' do
43
- dependency 'butter', '>= 1.0'
44
- end
45
- end
46
- end
47
- end
48
-
49
- let(:spec) do
50
- env.dsl do
51
- src 'source-1'
52
- src 'source-2' do
53
- dep 'jam'
54
- end
55
- end
56
- end
57
-
58
- let(:resolution) { resolver.resolve(spec) }
59
-
60
- specify { resolution.should be_correct }
61
-
62
- end
63
-
64
- context "a specfile with a dep depending on a nonexistent dep" do
65
-
66
- before do
67
- env.registry :clear => true do
68
- source 'source-1' do
69
- spec 'jam', '1.2' do
70
- dependency 'butter', '>= 1.0'
71
- end
72
- end
73
- end
74
- end
75
-
76
- let(:spec) do
77
- env.dsl do
78
- src 'source-1'
79
- dep 'jam'
80
- end
81
- end
82
-
83
- let(:resolution) { resolver.resolve(spec) }
84
-
85
- specify { resolution.should_not be_correct }
86
-
87
- end
88
-
89
- context "a specfile with conflicting constraints" do
90
-
91
- before do
92
- env.registry :clear => true do
93
- source 'source-1' do
94
- spec 'butter', '1.0'
95
- spec 'butter', '1.1'
96
- spec 'jam', '1.2' do
97
- dependency 'butter', '1.1'
98
- end
99
- end
100
- end
101
- end
102
-
103
- let(:spec) do
104
- env.dsl do
105
- src 'source-1'
106
- dep 'butter', '1.0'
107
- dep 'jam'
108
- end
109
- end
110
-
111
- let(:resolution) { resolver.resolve(spec) }
112
-
113
- specify { resolution.should_not be_correct }
114
-
115
- end
116
-
117
- context "updating" do
118
-
119
- it "should not work" do
120
- env.registry :clear => true do
121
- source 'source-1' do
122
- spec 'butter', '1.0'
123
- spec 'butter', '1.1'
124
- spec 'jam', '1.2' do
125
- dependency 'butter'
126
- end
127
- end
128
- end
129
- first_spec = env.dsl do
130
- src 'source-1'
131
- dep 'butter', '1.1'
132
- dep 'jam'
133
- end
134
- first_resolution = resolver.resolve(first_spec)
135
- first_resolution.should be_correct
136
- first_manifests = first_resolution.manifests
137
- first_manifests_index = Hash[first_manifests.map{|m| [m.name, m]}]
138
- first_manifests_index['butter'].version.to_s.should == '1.1'
139
-
140
- second_spec = env.dsl do
141
- src 'source-1'
142
- dep 'butter', '1.0'
143
- dep 'jam'
144
- end
145
- locked_manifests = ManifestSet.deep_strip(first_manifests, ['butter'])
146
- second_resolution =resolver.resolve(second_spec, locked_manifests)
147
- second_resolution.should be_correct
148
- second_manifests = second_resolution.manifests
149
- second_manifests_index = Hash[second_manifests.map{|m| [m.name, m]}]
150
- second_manifests_index['butter'].version.to_s.should == '1.0'
151
- end
152
-
153
- end
154
-
155
- context "a change to the spec" do
156
-
157
- it "should work" do
158
- env.registry :clear => true do
159
- source 'source-1' do
160
- spec 'butter', '1.0'
161
- end
162
- source 'source-2' do
163
- spec 'butter', '1.0'
164
- end
165
- end
166
- spec = env.dsl do
167
- src 'source-1'
168
- dep 'butter'
169
- end
170
- lock = resolver.resolve(spec)
171
- lock.should be_correct
172
-
173
- spec = env.dsl do
174
- src 'source-1'
175
- dep 'butter', :src => 'source-2'
176
- end
177
- changes = SpecChangeSet.new(env, spec, lock)
178
- changes.should_not be_same
179
- manifests = ManifestSet.new(changes.analyze).to_hash
180
- manifests.should_not have_key('butter')
181
- lock = resolver.resolve(spec, changes.analyze)
182
- lock.should be_correct
183
- lock.manifests.map{|m| m.name}.should include('butter')
184
- manifest = lock.manifests.find{|m| m.name == 'butter'}
185
- manifest.should_not be_nil
186
- manifest.source.name.should == 'source-2'
187
- end
188
-
189
- end
190
-
191
- end
192
- end