MuranoCLI 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +30 -59
- data/Gemfile +9 -3
- data/MuranoCLI.gemspec +11 -4
- data/bin/murano +2 -90
- data/lib/MrMurano.rb +5 -1
- data/lib/MrMurano/{spec_commander.rb → Commander-Entry.rb} +1 -2
- data/lib/MrMurano/Solution.rb +12 -15
- data/lib/MrMurano/SolutionId.rb +1 -5
- data/lib/MrMurano/SyncAllowed.rb +2 -2
- data/lib/MrMurano/SyncUpDown.rb +6 -3
- data/lib/MrMurano/progress.rb +11 -2
- data/lib/MrMurano/verbosing.rb +3 -2
- data/lib/MrMurano/version.rb +2 -2
- data/spec/Account-Passwords_spec.rb +34 -48
- data/spec/Account_spec.rb +58 -63
- data/spec/Business_spec.rb +151 -139
- data/spec/ConfigFile_spec.rb +15 -11
- data/spec/ConfigMigrate_spec.rb +23 -12
- data/spec/Config_spec.rb +57 -54
- data/spec/Content_spec.rb +233 -201
- data/spec/GatewayBase_spec.rb +35 -27
- data/spec/GatewayDevice_spec.rb +149 -149
- data/spec/GatewayResource_spec.rb +115 -102
- data/spec/GatewaySettings_spec.rb +69 -62
- data/spec/Http_spec.rb +66 -56
- data/spec/MakePretties_spec.rb +82 -73
- data/spec/Mock_spec.rb +38 -29
- data/spec/ProjectFile_spec.rb +118 -106
- data/spec/Setting_spec.rb +24 -15
- data/spec/Solution-ServiceConfig_spec.rb +168 -140
- data/spec/Solution-ServiceEventHandler_spec.rb +186 -188
- data/spec/Solution-ServiceModules_spec.rb +314 -232
- data/spec/Solution-UsersRoles_spec.rb +136 -86
- data/spec/Solution_spec.rb +78 -50
- data/spec/SyncRoot_spec.rb +26 -24
- data/spec/SyncUpDown_spec.rb +268 -249
- data/spec/Verbosing_spec.rb +95 -93
- data/spec/Webservice-Cors_spec.rb +141 -95
- data/spec/Webservice-Endpoint_spec.rb +382 -346
- data/spec/Webservice-File_spec.rb +148 -109
- data/spec/Webservice-Setting_spec.rb +47 -41
- data/spec/cmd_business_spec.rb +17 -17
- data/spec/cmd_common.rb +27 -7
- data/spec/cmd_config_spec.rb +31 -20
- data/spec/cmd_content_spec.rb +80 -68
- data/spec/cmd_cors_spec.rb +11 -5
- data/spec/cmd_device_spec.rb +16 -14
- data/spec/cmd_domain_spec.rb +10 -8
- data/spec/cmd_exchange_spec.rb +3 -3
- data/spec/cmd_init_spec.rb +100 -101
- data/spec/cmd_keystore_spec.rb +17 -12
- data/spec/cmd_link_spec.rb +22 -37
- data/spec/cmd_password_spec.rb +11 -7
- data/spec/cmd_setting_application_spec.rb +47 -33
- data/spec/cmd_setting_product_spec.rb +32 -27
- data/spec/cmd_status_spec.rb +125 -114
- data/spec/cmd_syncdown_spec.rb +70 -65
- data/spec/cmd_syncup_spec.rb +19 -15
- data/spec/cmd_usage_spec.rb +14 -10
- metadata +29 -15
data/spec/cmd_keystore_spec.rb
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# Last Modified: 2017.09.12 /coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# Copyright © 2016-2017 Exosite LLC.
|
5
|
+
# License: MIT. See LICENSE.txt.
|
6
|
+
# vim:tw=0:ts=2:sw=2:et:ai
|
7
|
+
|
1
8
|
require 'fileutils'
|
2
9
|
require 'open3'
|
3
10
|
require 'pathname'
|
@@ -5,7 +12,7 @@ require 'json'
|
|
5
12
|
require 'cmd_common'
|
6
13
|
|
7
14
|
RSpec.describe 'murano keystore', :cmd, :needs_password do
|
8
|
-
include_context
|
15
|
+
include_context 'CI_CMD'
|
9
16
|
|
10
17
|
before(:example) do
|
11
18
|
@product_name = rname('keystoreTest')
|
@@ -26,32 +33,32 @@ RSpec.describe 'murano keystore', :cmd, :needs_password do
|
|
26
33
|
expect(status.exitstatus).to eq(0)
|
27
34
|
end
|
28
35
|
|
29
|
-
it
|
36
|
+
it 'gets' do
|
30
37
|
out, err, status = Open3.capture3(capcmd('murano', 'keystore', 'get', 'bob'))
|
31
38
|
expect(out.chomp).to eq('built')
|
32
39
|
expect(err).to eq('')
|
33
40
|
expect(status.exitstatus).to eq(0)
|
34
41
|
end
|
35
42
|
|
36
|
-
it
|
43
|
+
it 'lists' do
|
37
44
|
out, err, status = Open3.capture3(capcmd('murano', 'keystore', 'list'))
|
38
45
|
expect(out.chomp).to eq('bob')
|
39
46
|
expect(err).to eq('')
|
40
47
|
expect(status.exitstatus).to eq(0)
|
41
48
|
end
|
42
49
|
|
43
|
-
it
|
50
|
+
it 'infos' do
|
44
51
|
out, err, status = Open3.capture3(capcmd('murano', 'keystore', 'info', '-c', 'outformat=json'))
|
45
|
-
expect{out = JSON.parse(out)}.to_not raise_error
|
52
|
+
expect { out = JSON.parse(out) }.to_not raise_error
|
46
53
|
expect(err).to eq('')
|
47
54
|
expect(status.exitstatus).to eq(0)
|
48
55
|
expect(out).to match(
|
49
|
-
'quota'=>{'keys' => a_kind_of(Integer)},
|
50
|
-
'usage'=>{'keys' => 1, 'size' => a_kind_of(Integer)},
|
56
|
+
'quota' => { 'keys' => a_kind_of(Integer) },
|
57
|
+
'usage' => { 'keys' => 1, 'size' => a_kind_of(Integer) },
|
51
58
|
)
|
52
59
|
end
|
53
60
|
|
54
|
-
it
|
61
|
+
it 'deletes' do
|
55
62
|
out, err, status = Open3.capture3(capcmd('murano', 'keystore', 'delete', 'bob'))
|
56
63
|
expect(out.chomp).to eq('')
|
57
64
|
expect(err).to eq('')
|
@@ -63,7 +70,7 @@ RSpec.describe 'murano keystore', :cmd, :needs_password do
|
|
63
70
|
expect(status.exitstatus).to eq(0)
|
64
71
|
end
|
65
72
|
|
66
|
-
it
|
73
|
+
it 'clearAll' do
|
67
74
|
out, err, status = Open3.capture3(capcmd('murano', 'keystore', 'set', 'another', 'value'))
|
68
75
|
expect(out.chomp).to eq('')
|
69
76
|
expect(err).to eq('')
|
@@ -80,7 +87,7 @@ RSpec.describe 'murano keystore', :cmd, :needs_password do
|
|
80
87
|
expect(status.exitstatus).to eq(0)
|
81
88
|
end
|
82
89
|
|
83
|
-
it
|
90
|
+
it 'can call other commands' do
|
84
91
|
out, err, status = Open3.capture3(capcmd('murano', 'keystore', 'command', 'lpush', 'another', 'value'))
|
85
92
|
expect(out.chomp).to eq('1')
|
86
93
|
expect(err).to eq('')
|
@@ -91,7 +98,5 @@ RSpec.describe 'murano keystore', :cmd, :needs_password do
|
|
91
98
|
expect(err).to eq('')
|
92
99
|
expect(status.exitstatus).to eq(0)
|
93
100
|
end
|
94
|
-
|
95
101
|
end
|
96
102
|
|
97
|
-
# vim: set ai et sw=2 ts=2 :
|
data/spec/cmd_link_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# Last Modified: 2017.
|
2
|
-
# frozen_string_literal:
|
1
|
+
# Last Modified: 2017.09.12 /coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
4
|
# Copyright © 2016-2017 Exosite LLC.
|
5
5
|
# License: MIT. See LICENSE.txt.
|
@@ -13,19 +13,19 @@ require 'cmd_common'
|
|
13
13
|
require 'MrMurano/Config'
|
14
14
|
|
15
15
|
RSpec.describe 'murano link', :cmd, :needs_password do
|
16
|
-
include_context
|
16
|
+
include_context 'CI_CMD'
|
17
17
|
|
18
|
-
context
|
19
|
-
it
|
18
|
+
context 'without project' do
|
19
|
+
it 'help' do
|
20
20
|
cmd_verify_help('link')
|
21
21
|
end
|
22
22
|
|
23
23
|
# 2017-08-30: The next two tests show the difference between using a
|
24
24
|
# subshell to run murano commands versus running them directly. The
|
25
25
|
# latter method lets us get coverage of the command modules.
|
26
|
-
context
|
27
|
-
context
|
28
|
-
it
|
26
|
+
context 'subshell vs inline' do
|
27
|
+
context 'using subshell' do
|
28
|
+
it 'will not list' do
|
29
29
|
out, err, status = Open3.capture3(capcmd('murano', 'link', 'list'))
|
30
30
|
expect(strip_color(out)).to eq(MrMurano::Config::INVALID_PROJECT_HINT + "\n")
|
31
31
|
expecting = %(The "link list" command only works in a Murano project.\n)
|
@@ -34,8 +34,8 @@ RSpec.describe 'murano link', :cmd, :needs_password do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
context
|
38
|
-
it
|
37
|
+
context 'using commander' do
|
38
|
+
it 'will not list' do
|
39
39
|
stdout, stderr = murano_command_run('link list')
|
40
40
|
expect(stdout).to eq(MrMurano::Config::INVALID_PROJECT_HINT + "\n")
|
41
41
|
expect(stderr).to eq(
|
@@ -46,32 +46,17 @@ RSpec.describe 'murano link', :cmd, :needs_password do
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
context
|
49
|
+
context 'with project' do
|
50
50
|
before(:example) { project_up(skip_link: true) }
|
51
51
|
after(:example) { project_down }
|
52
52
|
|
53
|
-
it
|
53
|
+
it 'links and lists' do
|
54
54
|
out, err, status = Open3.capture3(capcmd('murano', 'assign', 'set'))
|
55
55
|
#expect(out).to a_string_starting_with("Linked product #{@solz_name}")
|
56
56
|
olines = out.lines
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
# expected: "Linked \u2018syncdowntestprd1e8b4034\u2019
|
61
|
-
# to \u2018syncdowntestapp23d5135b\u2019\n"
|
62
|
-
# got: "Linked \xE2\x80\x98syncdowntestprd1e8b4034\xE2\x80\x99
|
63
|
-
# to \xE2\x80\x98syncdowntestapp23d5135b\xE2\x80\x99\n"
|
64
|
-
#
|
65
|
-
# or, to put it another way,
|
66
|
-
#
|
67
|
-
# -Linked ?syncdowntestprd1e8b4034? to ?syncdowntestapp23d5135b?
|
68
|
-
# +Linked ΓÇÿsyncdowntestprd1e8b4034ΓÇÖ to ΓÇÿsyncdowntestapp23d5135bΓÇÖ
|
69
|
-
#
|
70
|
-
# which we can solve with an encode call. (Or but using norm quotes.)
|
71
|
-
#
|
72
|
-
#expect(olines[0]).to eq("Linked ‘#{@solz_name}’ to ‘#{@solz_name}’\n")
|
73
|
-
expect(olines[0].encode!('UTF-8', 'UTF-8')).to eq(
|
74
|
-
"Linked ‘#{@proj_name_prod}’ to ‘#{@proj_name_appy}’\n"
|
58
|
+
expect(strip_fancy(olines[0])).to eq(
|
59
|
+
"Linked '#{@proj_name_prod}' to '#{@proj_name_appy}'\n"
|
75
60
|
)
|
76
61
|
|
77
62
|
expect(olines[1]).to eq("Created default event handler\n")
|
@@ -88,12 +73,12 @@ RSpec.describe 'murano link', :cmd, :needs_password do
|
|
88
73
|
expect(status.exitstatus).to eq(0)
|
89
74
|
end
|
90
75
|
|
91
|
-
it
|
76
|
+
it 'unlinks' do
|
92
77
|
out, err, status = Open3.capture3(capcmd('murano', 'assign', 'set'))
|
93
78
|
#expect(out).to a_string_starting_with("Linked product #{@solz_name}")
|
94
79
|
olines = out.lines
|
95
|
-
expect(olines[0]
|
96
|
-
"Linked
|
80
|
+
expect(strip_fancy(olines[0])).to eq(
|
81
|
+
"Linked '#{@proj_name_prod}' to '#{@proj_name_appy}'\n"
|
97
82
|
)
|
98
83
|
expect(olines[1]).to eq("Created default event handler\n")
|
99
84
|
expect(err).to eq('')
|
@@ -105,12 +90,12 @@ RSpec.describe 'murano link', :cmd, :needs_password do
|
|
105
90
|
# Unlinked ‘linktest3e7def1b86a1d680’ from ‘linktest3e7def1b86a1d680’\n
|
106
91
|
# Removed ‘h2thqll2z9sqoooc0_w4w3vxla11ngg4cok_event’ from ‘linktest3e7def1b86a1d680\n
|
107
92
|
olines = out.lines
|
108
|
-
expect(olines[0]
|
109
|
-
"Unlinked
|
93
|
+
expect(strip_fancy(olines[0])).to eq(
|
94
|
+
"Unlinked '#{@proj_name_prod}' from '#{@proj_name_appy}'\n"
|
110
95
|
)
|
111
|
-
expect(olines[1]
|
112
|
-
expect(olines[1]
|
113
|
-
/^Removed
|
96
|
+
expect(strip_fancy(olines[1])).to a_string_starting_with(%(Removed '))
|
97
|
+
expect(strip_fancy(olines[1])).to match(
|
98
|
+
/^Removed '[_a-z0-9]*' from '#{@proj_name_appy}'\n$/
|
114
99
|
)
|
115
100
|
expect(err).to eq('')
|
116
101
|
expect(status.exitstatus).to eq(0)
|
data/spec/cmd_password_spec.rb
CHANGED
@@ -1,12 +1,19 @@
|
|
1
|
+
# Last Modified: 2017.09.12 /coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# Copyright © 2016-2017 Exosite LLC.
|
5
|
+
# License: MIT. See LICENSE.txt.
|
6
|
+
# vim:tw=0:ts=2:sw=2:et:ai
|
7
|
+
|
1
8
|
require 'fileutils'
|
2
9
|
require 'open3'
|
3
10
|
require 'pathname'
|
4
11
|
require 'cmd_common'
|
5
12
|
|
6
13
|
RSpec.describe 'murano password', :cmd do
|
7
|
-
include_context
|
14
|
+
include_context 'CI_CMD'
|
8
15
|
|
9
|
-
it
|
16
|
+
it 'Lists when no file' do
|
10
17
|
out, err, status = Open3.capture3(capcmd('murano', 'password', 'list'))
|
11
18
|
expect(err).to eq('')
|
12
19
|
olines = out.lines
|
@@ -16,7 +23,7 @@ RSpec.describe 'murano password', :cmd do
|
|
16
23
|
expect(status.exitstatus).to eq(0)
|
17
24
|
end
|
18
25
|
|
19
|
-
it
|
26
|
+
it 'sets a password' do
|
20
27
|
out, err, status = Open3.capture3(capcmd('murano', 'password', 'set', 'bob@bob.bob', 'an.API.host.i', '--password', 'bad'))
|
21
28
|
expect(err).to eq('')
|
22
29
|
expect(out).to eq('')
|
@@ -33,7 +40,7 @@ RSpec.describe 'murano password', :cmd do
|
|
33
40
|
expect(status.exitstatus).to eq(0)
|
34
41
|
end
|
35
42
|
|
36
|
-
it
|
43
|
+
it 'deletes a password' do
|
37
44
|
File.open(File.join(ENV['HOME'], '.murano', 'passwords'), 'w') do |io|
|
38
45
|
io << "---\n"
|
39
46
|
io << "an.API.host.i:\n"
|
@@ -45,7 +52,6 @@ RSpec.describe 'murano password', :cmd do
|
|
45
52
|
expect(out).to eq('')
|
46
53
|
expect(status.exitstatus).to eq(0)
|
47
54
|
|
48
|
-
|
49
55
|
out, err, status = Open3.capture3(capcmd('murano', 'password', 'list'))
|
50
56
|
expect(err).to eq('')
|
51
57
|
olines = out.lines
|
@@ -56,7 +62,5 @@ RSpec.describe 'murano password', :cmd do
|
|
56
62
|
expect(olines[4]).to match(/^(\+-+){2}\+$/)
|
57
63
|
expect(status.exitstatus).to eq(0)
|
58
64
|
end
|
59
|
-
|
60
65
|
end
|
61
66
|
|
62
|
-
# vim: set ai et sw=2 ts=2 :
|
@@ -1,12 +1,19 @@
|
|
1
|
+
# Last Modified: 2017.09.12 /coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# Copyright © 2016-2017 Exosite LLC.
|
5
|
+
# License: MIT. See LICENSE.txt.
|
6
|
+
# vim:tw=0:ts=2:sw=2:et:ai
|
7
|
+
|
1
8
|
require 'fileutils'
|
9
|
+
require 'json'
|
2
10
|
require 'open3'
|
3
11
|
require 'pathname'
|
4
|
-
require 'json'
|
5
12
|
require 'vine'
|
6
13
|
require 'cmd_common'
|
7
14
|
|
8
15
|
RSpec.describe 'murano setting', :cmd, :needs_password do
|
9
|
-
include_context
|
16
|
+
include_context 'CI_CMD'
|
10
17
|
|
11
18
|
before(:example) do
|
12
19
|
@product_name = rname('settingtest')
|
@@ -22,14 +29,14 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
22
29
|
expect(status.exitstatus).to eq(0)
|
23
30
|
end
|
24
31
|
|
25
|
-
it
|
32
|
+
it 'reads Webservice.cors' do
|
26
33
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'read', 'Webservice.cors', '-c', 'outformat=json'))
|
27
34
|
expect { JSON.parse(out) }.to_not raise_error
|
28
35
|
expect(err).to eq('')
|
29
36
|
expect(status.exitstatus).to eq(0)
|
30
37
|
end
|
31
38
|
|
32
|
-
it
|
39
|
+
it 'reads Webservice.cors to a file' do
|
33
40
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'read', 'Webservice.cors', '-o', 'testout', '-c', 'outformat=json'))
|
34
41
|
expect(err).to eq('')
|
35
42
|
expect(out).to eq('')
|
@@ -37,20 +44,20 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
37
44
|
expect(File.exist?('testout')).to be true
|
38
45
|
end
|
39
46
|
|
40
|
-
context
|
47
|
+
context 'Writes (using Webservice.cors)' do
|
41
48
|
before(:example) do
|
42
49
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'read', 'Webservice.cors', '-c', 'outformat=json'))
|
43
50
|
expect { @json_before = JSON.parse(out) }.to_not raise_error
|
44
51
|
expect(err).to eq('')
|
45
52
|
expect(status.exitstatus).to eq(0)
|
46
53
|
end
|
47
|
-
# {
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
54
|
+
# {'origin'=>true,
|
55
|
+
# 'methods'=>['HEAD', 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'PATCH'],
|
56
|
+
# 'headers'=>['Content-Type', 'Cookie', 'Authorization'],
|
57
|
+
# 'credentials'=>true}
|
51
58
|
|
52
|
-
context
|
53
|
-
it
|
59
|
+
context 'a bool value' do
|
60
|
+
it 'Yes' do
|
54
61
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'Yes'))
|
55
62
|
expect(err).to eq('')
|
56
63
|
expect(out).to eq('')
|
@@ -65,7 +72,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
65
72
|
expect(json_after).to match(@json_before)
|
66
73
|
end
|
67
74
|
|
68
|
-
it
|
75
|
+
it 'true' do
|
69
76
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'true'))
|
70
77
|
expect(err).to eq('')
|
71
78
|
expect(out).to eq('')
|
@@ -80,7 +87,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
80
87
|
expect(json_after).to match(@json_before)
|
81
88
|
end
|
82
89
|
|
83
|
-
it
|
90
|
+
it 'on' do
|
84
91
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'on'))
|
85
92
|
expect(err).to eq('')
|
86
93
|
expect(out).to eq('')
|
@@ -95,7 +102,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
95
102
|
expect(json_after).to match(@json_before)
|
96
103
|
end
|
97
104
|
|
98
|
-
it
|
105
|
+
it '1' do
|
99
106
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', '1'))
|
100
107
|
expect(err).to eq('')
|
101
108
|
expect(out).to eq('')
|
@@ -110,14 +117,14 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
110
117
|
expect(json_after).to match(@json_before)
|
111
118
|
end
|
112
119
|
|
113
|
-
it
|
120
|
+
it 'bob' do
|
114
121
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'bob'))
|
115
122
|
expect(err).to eq("\e[31mValue \"bob\" is not a bool type!\e[0m\n")
|
116
123
|
expect(out).to eq('')
|
117
124
|
expect(status.exitstatus).to eq(2)
|
118
125
|
end
|
119
126
|
|
120
|
-
it
|
127
|
+
it 'No' do
|
121
128
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'No'))
|
122
129
|
expect(err).to eq('')
|
123
130
|
expect(out).to eq('')
|
@@ -132,7 +139,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
132
139
|
expect(json_after).to match(@json_before)
|
133
140
|
end
|
134
141
|
|
135
|
-
it
|
142
|
+
it 'false' do
|
136
143
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'false'))
|
137
144
|
expect(err).to eq('')
|
138
145
|
expect(out).to eq('')
|
@@ -147,7 +154,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
147
154
|
expect(json_after).to match(@json_before)
|
148
155
|
end
|
149
156
|
|
150
|
-
it
|
157
|
+
it 'off' do
|
151
158
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'Off'))
|
152
159
|
expect(err).to eq('')
|
153
160
|
expect(out).to eq('')
|
@@ -162,7 +169,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
162
169
|
expect(json_after).to match(@json_before)
|
163
170
|
end
|
164
171
|
|
165
|
-
it
|
172
|
+
it '0' do
|
166
173
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', '0'))
|
167
174
|
expect(err).to eq('')
|
168
175
|
expect(out).to eq('')
|
@@ -177,8 +184,8 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
177
184
|
expect(json_after).to match(@json_before)
|
178
185
|
end
|
179
186
|
|
180
|
-
it
|
181
|
-
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool'), :
|
187
|
+
it 'on STDIN' do
|
188
|
+
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool'), stdin_data: 'true')
|
182
189
|
expect(err).to eq('')
|
183
190
|
expect(out).to eq('')
|
184
191
|
expect(status.exitstatus).to eq(0)
|
@@ -193,7 +200,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
193
200
|
end
|
194
201
|
end
|
195
202
|
|
196
|
-
it
|
203
|
+
it 'a json array blob' do
|
197
204
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'headers', '--json', '["fidget", "forgotten", "tokens"]'))
|
198
205
|
expect(err).to eq('')
|
199
206
|
expect(out).to eq('')
|
@@ -204,12 +211,22 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
204
211
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
205
212
|
expect(err).to eq('')
|
206
213
|
expect(status.exitstatus).to eq(0)
|
207
|
-
@json_before['headers'] = [
|
214
|
+
@json_before['headers'] = %w[fidget forgotten tokens]
|
208
215
|
expect(json_after).to match(@json_before)
|
209
216
|
end
|
210
217
|
|
211
|
-
it
|
212
|
-
out, err, status = Open3.capture3(
|
218
|
+
it 'a json array blob with STDIN' do
|
219
|
+
out, err, status = Open3.capture3(
|
220
|
+
capcmd(
|
221
|
+
'murano',
|
222
|
+
'setting',
|
223
|
+
'write',
|
224
|
+
'Webservice.cors',
|
225
|
+
'headers',
|
226
|
+
'--json'
|
227
|
+
),
|
228
|
+
stdin_data: '["fidget", "forgotten", "tokens"]'
|
229
|
+
)
|
213
230
|
expect(err).to eq('')
|
214
231
|
expect(out).to eq('')
|
215
232
|
expect(status.exitstatus).to eq(0)
|
@@ -219,11 +236,11 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
219
236
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
220
237
|
expect(err).to eq('')
|
221
238
|
expect(status.exitstatus).to eq(0)
|
222
|
-
@json_before['headers'] = [
|
239
|
+
@json_before['headers'] = %w[fidget forgotten tokens]
|
223
240
|
expect(json_after).to match(@json_before)
|
224
241
|
end
|
225
242
|
|
226
|
-
it
|
243
|
+
it 'an array' do
|
227
244
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'headers', '--array', 'fidget', 'forgotten', 'tokens'))
|
228
245
|
expect(err).to eq('')
|
229
246
|
expect(out).to eq('')
|
@@ -234,11 +251,11 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
234
251
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
235
252
|
expect(err).to eq('')
|
236
253
|
expect(status.exitstatus).to eq(0)
|
237
|
-
@json_before['headers'] = [
|
254
|
+
@json_before['headers'] = %w[fidget forgotten tokens]
|
238
255
|
expect(json_after).to match(@json_before)
|
239
256
|
end
|
240
257
|
|
241
|
-
it
|
258
|
+
it 'appends an array' do
|
242
259
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'headers', '--array', '--append', 'fidget', 'forgotten', 'tokens'))
|
243
260
|
expect(err).to eq('')
|
244
261
|
expect(out).to eq('')
|
@@ -249,12 +266,9 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
249
266
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
250
267
|
expect(err).to eq('')
|
251
268
|
expect(status.exitstatus).to eq(0)
|
252
|
-
@json_before['headers'] = @json_before['headers'] + [
|
269
|
+
@json_before['headers'] = @json_before['headers'] + %w[fidget forgotten tokens]
|
253
270
|
expect(json_after).to match(@json_before)
|
254
271
|
end
|
255
|
-
|
256
272
|
end
|
257
|
-
|
258
273
|
end
|
259
274
|
|
260
|
-
# vim: set ai et sw=2 ts=2 :
|