vagrant-hypconfigmgmt 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d76a9d48cf7ce3ceb694c7feac30adb63563f762
4
- data.tar.gz: d87cbd2b7618529cec72d8d3501ebef9cb9069f1
3
+ metadata.gz: 90bd5ff306b35e2bf425db3939e780bb8dff0595
4
+ data.tar.gz: 10aae1e915a238463a352c479d67cbca95b11075
5
5
  SHA512:
6
- metadata.gz: 437077e4c2ee8fa22904b1456cb956ee36d498b31f9aefa692bef483dcd6607b29e0563f03558d1d51752718ce29fd90599c74e0ba79dd859aa2805be3eee906
7
- data.tar.gz: 45ccf4934e1280d519ca02ede7715a51f96d9a86e1e4c6c1012e02cad5b1b9bcb13836aa6d7695ad5ca77ff23fa504ea47320aae8f09fe1b41eaec7bd2ca5cdd
6
+ metadata.gz: 270c7ebde3ea17f028c7094aed595ab3838a4c3546beeb4099e71e64496e570d725a026935019774f818fa7d7a112b5f9ca4ffa63338b88ef8ca70d47d2c56c4
7
+ data.tar.gz: bc95f48e4f18e6b55a7bef4c1b7cae959d3353f6be006f3e6a27912f8756bffe082534d6a57a29472047088a0a29dedf2ff77464772b4cebe535e9d8c3cab3c0
data/Makefile CHANGED
@@ -10,7 +10,7 @@ all:
10
10
  test:
11
11
  bundle exec rspec spec/
12
12
  install:
13
- find pkg/ -name '*.gem' | tail -n 1 | xargs vagrant plugin install
13
+ find pkg/ -name '*.gem' | sort -nr | tail -n 1 | xargs vagrant plugin install
14
14
  clean:
15
15
  git clean -xfd
16
16
 
data/README.md CHANGED
@@ -11,5 +11,5 @@ Create the gemfile (package)
11
11
  ```
12
12
  $ make
13
13
  rake build
14
- vagrant-hypconfigmgmt 0.0.8 built to pkg/vagrant-hypconfigmgmt-0.0.9.gem.
14
+ vagrant-hypconfigmgmt 0.0.10 built to pkg/vagrant-hypconfigmgmt-0.0.10.gem.
15
15
  ```
@@ -5,7 +5,7 @@ DEFAULT_MAGENTO_VERSION = 2
5
5
  AVAILABLE_MAGENTO_VERSIONS = [1, 2]
6
6
 
7
7
  DEFAULT_PHP_VERSION = 7.0
8
- AVAILABLE_PHP_VERSIONS = [5.5, 5.6, 7.0]
8
+ AVAILABLE_PHP_VERSIONS = [5.5, 5.6, 7.0, 7.1]
9
9
 
10
10
  DEFAULT_VARNISH_STATE = false
11
11
  AVAILABLE_VARNISH_STATES = [true, false]
@@ -292,8 +292,8 @@ HEREDOC
292
292
  settings['vagrant']['box'] = 'hypernode_xenial'
293
293
  settings['vagrant']['box_url'] = 'http://vagrant.hypernode.com/customer/xenial/catalog.json'
294
294
  else
295
- if settings['php']['version'] == 5.6
296
- env[:ui].warning("The Precise Hypernodes don't have PHP5.6. Falling back to 5.5. Use the Xenial version of this box if you want PHP5.6")
295
+ if [5.6, 7.1].include? settings['php']['version']
296
+ env[:ui].warning("The Precise Hypernodes don't have PHP#{settings['php']['version']}. Falling back to 5.5. Use the Xenial version of this box if you want PHP#{settings['php']['version']}")
297
297
  settings['php']['version'] = 5.5
298
298
  end
299
299
  case settings['php']['version']
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Vagrant
5
5
  module Hypconfigmgmt
6
- VERSION = "0.0.9"
6
+ VERSION = "0.0.10"
7
7
  end
8
8
  end
Binary file
@@ -31,236 +31,323 @@ describe VagrantHypconfigmgmt::Command do
31
31
  context "when php 7.0 is configured but no ubuntu version specified" do
32
32
  let(:retrieved_settings) { { "php" => { "version" => 7.0 }, "vagrant" => Hash.new } }
33
33
  it "sets the box name and box url to the right values for PHP 7.0" do
34
- expected_settings = {
34
+ expected_settings = {
35
35
  "ubuntu_version" => "precise",
36
36
  "php" => {
37
- "version" => 7.0
38
- },
39
- "vagrant" => {
40
- "box" => "hypernode_php7",
41
- "box_url" => "http://vagrant.hypernode.com/customer/php7/catalog.json"
42
- }
43
- }
44
- # check if settings are retrieved from disk and pretend they return a configuration for php 7.0
37
+ "version" => 7.0
38
+ },
39
+ "vagrant" => {
40
+ "box" => "hypernode_php7",
41
+ "box_url" => "http://vagrant.hypernode.com/customer/php7/catalog.json"
42
+ }
43
+ }
44
+ # check if settings are retrieved from disk and pretend they return a configuration for php 7.0
45
45
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
46
- # check if the ubuntu version is gotten and pretend it returns precise
47
- expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
48
- # check if the settings that are written back to disk contain the right box (name) and box_url
46
+ # check if the ubuntu version is gotten and pretend it returns precise
47
+ expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
48
+ # check if the settings that are written back to disk contain the right box (name) and box_url
49
49
  expect(subject).to receive(:update_settings).once.with(expected_settings)
50
50
  end
51
51
  end
52
52
 
53
+
53
54
  context "when php 7.0 is configured and precise ubuntu version specified" do
54
55
  let(:retrieved_settings) { { "php" => { "version" => 7.0 }, "vagrant" => Hash.new, "ubuntu_version" => "precise" } }
55
56
  it "sets the box name and box url to the right values for PHP 7.0" do
56
- expected_settings = {
57
+ expected_settings = {
57
58
  "ubuntu_version" => "precise",
58
59
  "php" => {
59
- "version" => 7.0
60
- },
61
- "vagrant" => {
62
- "box" => "hypernode_php7",
63
- "box_url" => "http://vagrant.hypernode.com/customer/php7/catalog.json"
64
- }
65
- }
66
- # check if settings are retrieved from disk and pretend they return a configuration for php 7.0
60
+ "version" => 7.0
61
+ },
62
+ "vagrant" => {
63
+ "box" => "hypernode_php7",
64
+ "box_url" => "http://vagrant.hypernode.com/customer/php7/catalog.json"
65
+ }
66
+ }
67
+ # check if settings are retrieved from disk and pretend they return a configuration for php 7.0
67
68
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
68
- # check if the ubuntu version is not gotten because we already have it specified in the settings
69
- expect(subject).to receive(:get_ubuntu_version).never
70
- # check if the settings that are written back to disk contain the right box (name) and box_url
69
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
70
+ expect(subject).to receive(:get_ubuntu_version).never
71
+ # check if the settings that are written back to disk contain the right box (name) and box_url
71
72
  expect(subject).to receive(:update_settings).once.with(expected_settings)
72
73
  end
73
74
  end
74
75
 
76
+
75
77
  context "when php 7.0 is configured and xenial ubuntu version specified" do
76
78
  let(:retrieved_settings) { { "php" => { "version" => 7.0 }, "vagrant" => Hash.new, "ubuntu_version" => "xenial" } }
77
79
  it "sets the box name and box url to the right values for PHP 7.0" do
78
- expected_settings = {
80
+ expected_settings = {
79
81
  "ubuntu_version" => "xenial",
80
82
  "php" => {
81
- "version" => 7.0
82
- },
83
- "vagrant" => {
84
- "box" => "hypernode_xenial",
85
- "box_url" => "http://vagrant.hypernode.com/customer/xenial/catalog.json"
86
- }
87
- }
88
- # check if settings are retrieved from disk and pretend they return a configuration for php 7.0
83
+ "version" => 7.0
84
+ },
85
+ "vagrant" => {
86
+ "box" => "hypernode_xenial",
87
+ "box_url" => "http://vagrant.hypernode.com/customer/xenial/catalog.json"
88
+ }
89
+ }
90
+ # check if settings are retrieved from disk and pretend they return a configuration for php 7.0
89
91
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
90
- # check if the ubuntu version is not gotten because we already have it specified in the settings
91
- expect(subject).to receive(:get_ubuntu_version).never
92
- # check if the settings that are written back to disk contain the right box (name) and box_url
92
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
93
+ expect(subject).to receive(:get_ubuntu_version).never
94
+ # check if the settings that are written back to disk contain the right box (name) and box_url
93
95
  expect(subject).to receive(:update_settings).once.with(expected_settings)
94
96
  end
95
97
  end
96
98
 
99
+
97
100
  context "when php 5.5 is configured but no ubuntu version specified" do
98
101
  let(:retrieved_settings) { { "php" => { "version" => 5.5 }, "vagrant" => Hash.new } }
99
102
  it "sets the box name and box url to the right values for PHP 5.5" do
100
- expected_settings = {
103
+ expected_settings = {
101
104
  "ubuntu_version" => "precise",
102
105
  "php" => {
103
- "version" => 5.5
104
- },
105
- "vagrant" => {
106
- "box" => "hypernode_php5",
107
- "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
108
- }
109
- }
110
- # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
106
+ "version" => 5.5
107
+ },
108
+ "vagrant" => {
109
+ "box" => "hypernode_php5",
110
+ "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
111
+ }
112
+ }
113
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
111
114
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
112
- # check if the ubuntu version is gotten and pretend it returns precise
113
- expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
114
- # check if the settings that are written back to disk contain the right box (name) and box_url
115
+ # check if the ubuntu version is gotten and pretend it returns precise
116
+ expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
117
+ # check if the settings that are written back to disk contain the right box (name) and box_url
115
118
  expect(subject).to receive(:update_settings).once.with(expected_settings)
116
119
  end
117
120
  end
118
121
 
122
+
119
123
  context "when php 5.5 is configured and precise ubuntu version specified" do
120
124
  let(:retrieved_settings) { { "php" => { "version" => 5.5 }, "vagrant" => Hash.new, "ubuntu_version" => "precise" } }
121
125
  it "sets the box name and box url to the right values for PHP 5.5" do
122
- expected_settings = {
126
+ expected_settings = {
123
127
  "ubuntu_version" => "precise",
124
128
  "php" => {
125
- "version" => 5.5
126
- },
127
- "vagrant" => {
128
- "box" => "hypernode_php5",
129
- "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
130
- }
131
- }
132
- # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
129
+ "version" => 5.5
130
+ },
131
+ "vagrant" => {
132
+ "box" => "hypernode_php5",
133
+ "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
134
+ }
135
+ }
136
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
133
137
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
134
- # check if the ubuntu version is not gotten because we already have it specified in the settings
135
- expect(subject).to receive(:get_ubuntu_version).never
136
- # check if the settings that are written back to disk contain the right box (name) and box_url
138
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
139
+ expect(subject).to receive(:get_ubuntu_version).never
140
+ # check if the settings that are written back to disk contain the right box (name) and box_url
137
141
  expect(subject).to receive(:update_settings).once.with(expected_settings)
138
142
  end
139
143
  end
140
144
 
145
+
141
146
  context "when php 5.5 is configured and xenial ubuntu version specified" do
142
147
  let(:retrieved_settings) { { "php" => { "version" => 5.5 }, "vagrant" => Hash.new, "ubuntu_version" => "xenial" } }
143
148
  it "sets the box name and box url to the right values for PHP 5.5" do
144
- expected_settings = {
149
+ expected_settings = {
145
150
  "ubuntu_version" => "xenial",
146
151
  "php" => {
147
- "version" => 5.5
148
- },
149
- "vagrant" => {
150
- "box" => "hypernode_xenial",
151
- "box_url" => "http://vagrant.hypernode.com/customer/xenial/catalog.json"
152
- }
153
- }
154
- # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
152
+ "version" => 5.5
153
+ },
154
+ "vagrant" => {
155
+ "box" => "hypernode_xenial",
156
+ "box_url" => "http://vagrant.hypernode.com/customer/xenial/catalog.json"
157
+ }
158
+ }
159
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
155
160
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
156
- # check if the ubuntu version is not gotten because we already have it specified in the settings
157
- expect(subject).to receive(:get_ubuntu_version).never
158
- # check if the settings that are written back to disk contain the right box (name) and box_url
161
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
162
+ expect(subject).to receive(:get_ubuntu_version).never
163
+ # check if the settings that are written back to disk contain the right box (name) and box_url
159
164
  expect(subject).to receive(:update_settings).once.with(expected_settings)
160
165
  end
161
166
  end
162
167
 
168
+
163
169
  context "when php 5.6 is configured but no ubuntu version specified" do
164
170
  let(:retrieved_settings) { { "php" => { "version" => 5.6 }, "vagrant" => Hash.new } }
165
171
  it "sets the box name and box url to the right values for PHP 5.6" do
166
- expected_settings = {
172
+ expected_settings = {
167
173
  "ubuntu_version" => "precise",
168
174
  "php" => {
169
- "version" => 5.5
170
- },
171
- "vagrant" => {
175
+ "version" => 5.5
176
+ },
177
+ "vagrant" => {
172
178
  # Falling back to php5.5, Precise Hypernodes have no PHP5.6
173
- "box" => "hypernode_php5",
174
- "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
175
- }
176
- }
177
- # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
179
+ "box" => "hypernode_php5",
180
+ "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
181
+ }
182
+ }
183
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
184
+ expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
185
+ # check if the ubuntu version is gotten and pretend it returns precise
186
+ expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
187
+ # check if the settings that are written back to disk contain the right box (name) and box_url
188
+ expect(subject).to receive(:update_settings).once.with(expected_settings)
189
+ # check if the user is warned about falling back to 5.5
190
+ expect(ui).to receive(:warning).once.with(/.*Falling back to 5.5*/)
191
+ end
192
+ end
193
+
194
+
195
+ context "when php 7.1 is configured but no ubuntu version specified" do
196
+ let(:retrieved_settings) { { "php" => { "version" => 7.1 }, "vagrant" => Hash.new } }
197
+ it "sets the box name and box url to the right values for PHP 7.1" do
198
+ expected_settings = {
199
+ "ubuntu_version" => "precise",
200
+ "php" => {
201
+ "version" => 5.5
202
+ },
203
+ "vagrant" => {
204
+ # Falling back to php5.5, Precise Hypernodes have no PHP7.1
205
+ "box" => "hypernode_php5",
206
+ "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
207
+ }
208
+ }
209
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
178
210
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
179
- # check if the ubuntu version is gotten and pretend it returns precise
180
- expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
181
- # check if the settings that are written back to disk contain the right box (name) and box_url
211
+ # check if the ubuntu version is gotten and pretend it returns precise
212
+ expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
213
+ # check if the settings that are written back to disk contain the right box (name) and box_url
182
214
  expect(subject).to receive(:update_settings).once.with(expected_settings)
183
- # check if the user is warned about falling back to 5.5
184
- expect(ui).to receive(:warning).once.with(/.*Falling back to 5.5*/)
215
+ # check if the user is warned about falling back to 5.5
216
+ expect(ui).to receive(:warning).once.with(/.*Falling back to 5.5*/)
185
217
  end
186
218
  end
187
219
 
220
+
188
221
  context "when php 5.6 is configured and precise ubuntu version specified" do
189
222
  let(:retrieved_settings) { { "php" => { "version" => 5.6 }, "vagrant" => Hash.new, "ubuntu_version" => "precise" } }
190
223
  it "sets the box name and box url to the right values for PHP 5.5" do
191
- expected_settings = {
224
+ expected_settings = {
192
225
  "ubuntu_version" => "precise",
193
226
  "php" => {
194
227
  # Falling back to php5.5, Precise Hypernodes have no PHP5.6
195
- "version" => 5.5
196
- },
197
- "vagrant" => {
198
- "box" => "hypernode_php5",
199
- "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
200
- }
201
- }
202
- # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
228
+ "version" => 5.5
229
+ },
230
+ "vagrant" => {
231
+ "box" => "hypernode_php5",
232
+ "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
233
+ }
234
+ }
235
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
236
+ expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
237
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
238
+ expect(subject).to receive(:get_ubuntu_version).never
239
+ # check if the settings that are written back to disk contain the right box (name) and box_url
240
+ expect(subject).to receive(:update_settings).once.with(expected_settings)
241
+ # check if the user is warned about falling back to 5.5
242
+ expect(ui).to receive(:warning).once.with(/.*Falling back to 5.5*/)
243
+ end
244
+ end
245
+
246
+
247
+ context "when php 5.6 is configured and precise ubuntu version specified" do
248
+ let(:retrieved_settings) { { "php" => { "version" => 7.1 }, "vagrant" => Hash.new, "ubuntu_version" => "precise" } }
249
+ it "sets the box name and box url to the right values for PHP 5.5" do
250
+ expected_settings = {
251
+ "ubuntu_version" => "precise",
252
+ "php" => {
253
+ # Falling back to php5.5, Precise Hypernodes have no PHP7.1
254
+ "version" => 5.5
255
+ },
256
+ "vagrant" => {
257
+ "box" => "hypernode_php5",
258
+ "box_url" => "http://vagrant.hypernode.com/customer/php5/catalog.json"
259
+ }
260
+ }
261
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
203
262
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
204
- # check if the ubuntu version is not gotten because we already have it specified in the settings
205
- expect(subject).to receive(:get_ubuntu_version).never
206
- # check if the settings that are written back to disk contain the right box (name) and box_url
263
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
264
+ expect(subject).to receive(:get_ubuntu_version).never
265
+ # check if the settings that are written back to disk contain the right box (name) and box_url
207
266
  expect(subject).to receive(:update_settings).once.with(expected_settings)
208
- # check if the user is warned about falling back to 5.5
209
- expect(ui).to receive(:warning).once.with(/.*Falling back to 5.5*/)
267
+ # check if the user is warned about falling back to 5.5
268
+ expect(ui).to receive(:warning).once.with(/.*Falling back to 5.5*/)
210
269
  end
211
270
  end
212
271
 
272
+
213
273
  context "when php 5.6 is configured and xenial ubuntu version specified" do
214
274
  let(:retrieved_settings) { { "php" => { "version" => 5.6 }, "vagrant" => Hash.new, "ubuntu_version" => "xenial" } }
215
275
  it "sets the box name and box url to the right values for PHP 5.6" do
216
- expected_settings = {
276
+ expected_settings = {
277
+ "ubuntu_version" => "xenial",
278
+ "php" => {
279
+ "version" => 5.6
280
+ },
281
+ "vagrant" => {
282
+ "box" => "hypernode_xenial",
283
+ "box_url" => "http://vagrant.hypernode.com/customer/xenial/catalog.json"
284
+ }
285
+ }
286
+ # check if settings are retrieved from disk and pretend they return a configuration for php 5.6
287
+ expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
288
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
289
+ expect(subject).to receive(:get_ubuntu_version).never
290
+ # check if the settings that are written back to disk contain the right box (name) and box_url
291
+ expect(subject).to receive(:update_settings).once.with(expected_settings)
292
+ # check that the user is not warned about falling back because we do have 5.6 on Xenial
293
+ expect(ui).to receive(:warning).never
294
+ end
295
+ end
296
+
297
+
298
+ context "when php 7.1 is configured and xenial ubuntu version specified" do
299
+ let(:retrieved_settings) { { "php" => { "version" => 7.1 }, "vagrant" => Hash.new, "ubuntu_version" => "xenial" } }
300
+ it "sets the box name and box url to the right values for PHP 7.1" do
301
+ expected_settings = {
217
302
  "ubuntu_version" => "xenial",
218
303
  "php" => {
219
- "version" => 5.6
220
- },
221
- "vagrant" => {
222
- "box" => "hypernode_xenial",
223
- "box_url" => "http://vagrant.hypernode.com/customer/xenial/catalog.json"
224
- }
225
- }
226
- # check if settings are retrieved from disk and pretend they return a configuration for php 5.5
304
+ "version" => 7.1
305
+ },
306
+ "vagrant" => {
307
+ "box" => "hypernode_xenial",
308
+ "box_url" => "http://vagrant.hypernode.com/customer/xenial/catalog.json"
309
+ }
310
+ }
311
+ # check if settings are retrieved from disk and pretend they return a configuration for php 7.1
227
312
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
228
- # check if the ubuntu version is not gotten because we already have it specified in the settings
229
- expect(subject).to receive(:get_ubuntu_version).never
230
- # check if the settings that are written back to disk contain the right box (name) and box_url
313
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
314
+ expect(subject).to receive(:get_ubuntu_version).never
315
+ # check if the settings that are written back to disk contain the right box (name) and box_url
231
316
  expect(subject).to receive(:update_settings).once.with(expected_settings)
232
- # check that the user is not warned about falling back because we do have 5.6 on Xenial
233
- expect(ui).to receive(:warning).never
317
+ # check that the user is not warned about falling back because we do have 5.6 on Xenial
318
+ expect(ui).to receive(:warning).never
234
319
  end
235
320
  end
236
321
 
322
+
237
323
  context "when an unknown php version is configured" do
238
324
  let(:retrieved_settings) { { "php" => { "version" => 1.0 }, "vagrant" => Hash.new } }
239
325
  it "does not set the box name and box url" do
240
- expected_settings = {
326
+ expected_settings = {
241
327
  "ubuntu_version" => "precise",
242
328
  "php" => {
243
- "version" => 1.0
244
- },
245
- "vagrant" => Hash.new
246
- }
247
- # check if settings are retrieved from disk and pretend they return an invalid php version
329
+ "version" => 1.0
330
+ },
331
+ "vagrant" => Hash.new
332
+ }
333
+ # check if settings are retrieved from disk and pretend they return an invalid php version
248
334
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
249
- # check if the ubuntu version is gotten and pretend it returns precise
250
- expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
251
- # check if the settings we write back to disk have an unaltered box (name) and box_url
335
+ # check if the ubuntu version is gotten and pretend it returns precise
336
+ expect(subject).to receive(:get_ubuntu_version).once.with(env).and_return('precise')
337
+ # check if the settings we write back to disk have an unaltered box (name) and box_url
252
338
  expect(subject).to receive(:update_settings).once.with(expected_settings)
253
339
  end
254
340
  end
255
341
 
342
+
256
343
  context "when an unknown php version is configured and xenial ubuntu version specified" do
257
344
  let(:retrieved_settings) { { "php" => { "version" => 1.0 }, "vagrant" => Hash.new, "ubuntu_version" => "xenial" } }
258
345
  it "does not set the box name and box url" do
259
- # check if settings are retrieved from disk and pretend they return an invalid php version
346
+ # check if settings are retrieved from disk and pretend they return an invalid php version
260
347
  expect(subject).to receive(:retrieve_settings).once.with(no_args).and_return(retrieved_settings)
261
- # check if the ubuntu version is not gotten because we already have it specified in the settings
262
- expect(subject).to receive(:get_ubuntu_version).never
263
- # check if the settings we write back to disk have an unaltered box (name) and box_url
348
+ # check if the ubuntu version is not gotten because we already have it specified in the settings
349
+ expect(subject).to receive(:get_ubuntu_version).never
350
+ # check if the settings we write back to disk have an unaltered box (name) and box_url
264
351
  expect(subject).to receive(:update_settings).once.with(retrieved_settings)
265
352
  end
266
353
  end
@@ -34,7 +34,7 @@ describe VagrantHypconfigmgmt::Command do
34
34
 
35
35
  context "when the options are floats" do
36
36
  it "it casts the floats to strings and returns them separated by 'or'" do
37
- expect( subject.get_options_string([5.5, 5.6, 7.0]) ).to eq("5.5 or 5.6 or 7.0")
37
+ expect( subject.get_options_string([5.5, 5.6, 7.0, 7.1]) ).to eq("5.5 or 5.6 or 7.0 or 7.1")
38
38
  end
39
39
  end
40
40
 
@@ -25,14 +25,14 @@ describe VagrantHypconfigmgmt::Command do
25
25
 
26
26
  context "when PHP 5.5 is configured" do
27
27
  it "it notifies the user that PHP 5.5 will be used and returns the value" do
28
- # check if the setting is prompted for and pretend it returns a "PHP 5.5" answer
28
+ # check if the setting is prompted for and pretend it returns a "PHP 5.5" answer
29
29
  expect(subject).to receive(:get_setting).with(
30
- env, AVAILABLE_PHP_VERSIONS, DEFAULT_PHP_VERSION,
31
- "Is this a PHP #{subject.get_options_string(AVAILABLE_PHP_VERSIONS)} Hypernode? [default #{DEFAULT_PHP_VERSION}]: "
32
- ).and_return("5.5")
30
+ env, AVAILABLE_PHP_VERSIONS, DEFAULT_PHP_VERSION,
31
+ "Is this a PHP #{subject.get_options_string(AVAILABLE_PHP_VERSIONS)} Hypernode? [default #{DEFAULT_PHP_VERSION}]: "
32
+ ).and_return("5.5")
33
33
  # check if the user is notified about the PHP version
34
34
  expect(ui).to receive(:info).once.with(/.*PHP 5.5*/)
35
- # check if the function returns float 5.5 if a PHP 5.5 Vagrant is to be used
35
+ # check if the function returns float 5.5 if a PHP 5.5 Vagrant is to be used
36
36
  expect( subject.get_php_version(env) ).to eq(5.5)
37
37
  end
38
38
  end
@@ -40,14 +40,14 @@ describe VagrantHypconfigmgmt::Command do
40
40
 
41
41
  context "when PHP 5.6 is configured" do
42
42
  it "it notifies the user that PHP 5.6 will be used and returns the value" do
43
- # check if the setting is prompted for and pretend it returns a "PHP 5.6" answer
43
+ # check if the setting is prompted for and pretend it returns a "PHP 5.6" answer
44
44
  expect(subject).to receive(:get_setting).with(
45
- env, AVAILABLE_PHP_VERSIONS, DEFAULT_PHP_VERSION,
46
- "Is this a PHP #{subject.get_options_string(AVAILABLE_PHP_VERSIONS)} Hypernode? [default #{DEFAULT_PHP_VERSION}]: "
47
- ).and_return("5.6")
45
+ env, AVAILABLE_PHP_VERSIONS, DEFAULT_PHP_VERSION,
46
+ "Is this a PHP #{subject.get_options_string(AVAILABLE_PHP_VERSIONS)} Hypernode? [default #{DEFAULT_PHP_VERSION}]: "
47
+ ).and_return("5.6")
48
48
  # check if the user is notified about the PHP version
49
49
  expect(ui).to receive(:info).once.with(/.*PHP 5.6*/)
50
- # check if the function returns float 5.5 if a PHP 5.5 Vagrant is to be used
50
+ # check if the function returns float 5.5 if a PHP 5.5 Vagrant is to be used
51
51
  expect( subject.get_php_version(env) ).to eq(5.6)
52
52
  end
53
53
  end
@@ -55,17 +55,32 @@ describe VagrantHypconfigmgmt::Command do
55
55
 
56
56
  context "when PHP 7.0 is configured" do
57
57
  it "it notifies the user that PHP 7.0 will be used and returns the value" do
58
- # check if the setting is prompted for and pretend it returns a "PHP 7.0" answer
58
+ # check if the setting is prompted for and pretend it returns a "PHP 7.0" answer
59
59
  expect(subject).to receive(:get_setting).with(
60
- env, AVAILABLE_PHP_VERSIONS, DEFAULT_PHP_VERSION,
61
- "Is this a PHP #{subject.get_options_string(AVAILABLE_PHP_VERSIONS)} Hypernode? [default #{DEFAULT_PHP_VERSION}]: "
62
- ).and_return("7.0")
60
+ env, AVAILABLE_PHP_VERSIONS, DEFAULT_PHP_VERSION,
61
+ "Is this a PHP #{subject.get_options_string(AVAILABLE_PHP_VERSIONS)} Hypernode? [default #{DEFAULT_PHP_VERSION}]: "
62
+ ).and_return("7.0")
63
63
  # check if the user is notified about the PHP version
64
64
  expect(ui).to receive(:info).once.with(/.*PHP 7.0*/)
65
- # check if the function returns float 7.0 if a PHP 7.0 Vagrant is to be used
65
+ # check if the function returns float 7.0 if a PHP 7.0 Vagrant is to be used
66
66
  expect( subject.get_php_version(env) ).to eq(7.0)
67
67
  end
68
68
  end
69
+
70
+
71
+ context "when PHP 7.1 is configured" do
72
+ it "it notifies the user that PHP 7.1 will be used and returns the value" do
73
+ # check if the setting is prompted for and pretend it returns a "PHP 7.1" answer
74
+ expect(subject).to receive(:get_setting).with(
75
+ env, AVAILABLE_PHP_VERSIONS, DEFAULT_PHP_VERSION,
76
+ "Is this a PHP #{subject.get_options_string(AVAILABLE_PHP_VERSIONS)} Hypernode? [default #{DEFAULT_PHP_VERSION}]: "
77
+ ).and_return("7.1")
78
+ # check if the user is notified about the PHP version
79
+ expect(ui).to receive(:info).once.with(/.*PHP 7.1*/)
80
+ # check if the function returns float 7.1 if a PHP 7.1 Vagrant is to be used
81
+ expect( subject.get_php_version(env) ).to eq(7.1)
82
+ end
83
+ end
69
84
  end
70
85
  end
71
86
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-hypconfigmgmt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick van de Loo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-12 00:00:00.000000000 Z
11
+ date: 2018-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -98,7 +98,7 @@ files:
98
98
  - lib/vagrant-hypconfigmgmt/command.rb
99
99
  - lib/vagrant-hypconfigmgmt/config.rb
100
100
  - lib/vagrant-hypconfigmgmt/version.rb
101
- - pkg/vagrant-hypconfigmgmt-0.0.8.gem
101
+ - pkg/vagrant-hypconfigmgmt-0.0.9.gem
102
102
  - spec/spec_helper.rb
103
103
  - spec/unit/command/call_spec.rb
104
104
  - spec/unit/command/configure_cgroup_spec.rb
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  version: '0'
156
156
  requirements: []
157
157
  rubyforge_project:
158
- rubygems_version: 2.5.1
158
+ rubygems_version: 2.5.2.1
159
159
  signing_key:
160
160
  specification_version: 4
161
161
  summary: Prompt to configure a hypernode-vagrant
Binary file