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_device_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.
         | 
| @@ -11,7 +11,7 @@ require 'pathname' | |
| 11 11 | 
             
            require 'cmd_common'
         | 
| 12 12 |  | 
| 13 13 | 
             
            RSpec.describe 'murano device', :cmd, :needs_password do
         | 
| 14 | 
            -
              include_context  | 
| 14 | 
            +
              include_context 'CI_CMD'
         | 
| 15 15 |  | 
| 16 16 | 
             
              before(:example) do
         | 
| 17 17 | 
             
                @product_name = rname('deviceTest')
         | 
| @@ -27,7 +27,7 @@ RSpec.describe 'murano device', :cmd, :needs_password do | |
| 27 27 | 
             
                expect(status.exitstatus).to eq(0)
         | 
| 28 28 | 
             
              end
         | 
| 29 29 |  | 
| 30 | 
            -
              it  | 
| 30 | 
            +
              it 'enables and lists' do
         | 
| 31 31 | 
             
                out, err, status = Open3.capture3(capcmd('murano', 'product', 'device', 'enable', '12345'))
         | 
| 32 32 | 
             
                expect(out).to eq('')
         | 
| 33 33 | 
             
                expect(err).to eq('')
         | 
| @@ -44,7 +44,7 @@ RSpec.describe 'murano device', :cmd, :needs_password do | |
| 44 44 | 
             
                expect(status.exitstatus).to eq(0)
         | 
| 45 45 | 
             
              end
         | 
| 46 46 |  | 
| 47 | 
            -
              it  | 
| 47 | 
            +
              it 'enables a batch' do
         | 
| 48 48 | 
             
                File.open('ids.csv', 'w') do |io|
         | 
| 49 49 | 
             
                  io << "ID\n"
         | 
| 50 50 | 
             
                  io << "1234\n"
         | 
| @@ -70,7 +70,7 @@ RSpec.describe 'murano device', :cmd, :needs_password do | |
| 70 70 | 
             
                expect(status.exitstatus).to eq(0)
         | 
| 71 71 | 
             
              end
         | 
| 72 72 |  | 
| 73 | 
            -
              it  | 
| 73 | 
            +
              it 'activates' do
         | 
| 74 74 | 
             
                out, err, status = Open3.capture3(capcmd('murano', 'product', 'device', 'enable', '12345'))
         | 
| 75 75 | 
             
                expect(out).to eq('')
         | 
| 76 76 | 
             
                expect(err).to eq('')
         | 
| @@ -85,7 +85,7 @@ RSpec.describe 'murano device', :cmd, :needs_password do | |
| 85 85 | 
             
                expect(status.exitstatus).to eq(0)
         | 
| 86 86 | 
             
              end
         | 
| 87 87 |  | 
| 88 | 
            -
              it  | 
| 88 | 
            +
              it 'writes and reads' do
         | 
| 89 89 | 
             
                FileUtils.mkpath('specs')
         | 
| 90 90 | 
             
                FileUtils.copy(
         | 
| 91 91 | 
             
                  File.join(@testdir, 'spec/fixtures/product_spec_files/lightbulb.yaml'),
         | 
| @@ -128,13 +128,15 @@ RSpec.describe 'murano device', :cmd, :needs_password do | |
| 128 128 | 
             
                out, err, status = Open3.capture3(capcmd('murano', 'product', 'device', 'read', '12345', 'state'))
         | 
| 129 129 | 
             
                #expect(out.strip).to eq('42')
         | 
| 130 130 | 
             
                expect(err).to eq('')
         | 
| 131 | 
            -
                expect(out.lines).to match_array( | 
| 132 | 
            -
                   | 
| 133 | 
            -
             | 
| 134 | 
            -
             | 
| 135 | 
            -
             | 
| 136 | 
            -
             | 
| 137 | 
            -
             | 
| 131 | 
            +
                expect(out.lines).to match_array(
         | 
| 132 | 
            +
                  [
         | 
| 133 | 
            +
                    /^(\+-+){4}\+$/,
         | 
| 134 | 
            +
                    /^\| Alias\s+\| Reported\s+\| Set\s+\| Timestamp\s+\|$/,
         | 
| 135 | 
            +
                    /^(\+-+){4}\+$/,
         | 
| 136 | 
            +
                    /^\| state\s+\| \s+\| 42\s+\| \d+\s+\|$/,
         | 
| 137 | 
            +
                    /^(\+-+){4}\+$/,
         | 
| 138 | 
            +
                  ]
         | 
| 139 | 
            +
                )
         | 
| 138 140 | 
             
                expect(status.exitstatus).to eq(0)
         | 
| 139 141 | 
             
              end
         | 
| 140 142 | 
             
            end
         | 
    
        data/spec/cmd_domain_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.
         | 
| @@ -11,7 +11,7 @@ require 'pathname' | |
| 11 11 | 
             
            require 'cmd_common'
         | 
| 12 12 |  | 
| 13 13 | 
             
            RSpec.describe 'murano domain', :cmd, :needs_password do
         | 
| 14 | 
            -
              include_context  | 
| 14 | 
            +
              include_context 'CI_CMD'
         | 
| 15 15 |  | 
| 16 16 | 
             
              before(:example) do
         | 
| 17 17 | 
             
                @product_name = rname('domainTest')
         | 
| @@ -36,17 +36,19 @@ RSpec.describe 'murano domain', :cmd, :needs_password do | |
| 36 36 | 
             
                expect(status.exitstatus).to eq(0)
         | 
| 37 37 | 
             
              end
         | 
| 38 38 |  | 
| 39 | 
            -
              it  | 
| 39 | 
            +
              it 'show domain' do
         | 
| 40 40 | 
             
                out, err, status = Open3.capture3(capcmd('murano', 'domain'))
         | 
| 41 41 | 
             
                # 2017-05-31: Previously, the project could be named whatever and
         | 
| 42 42 | 
             
                #   the URI would start with the same.
         | 
| 43 | 
            -
                #     expect(out.chomp).to start_with("#{@product_name.downcase}.apps.exosite").and end_with( | 
| 44 | 
            -
                #   Now, it's: <ID>.m2.exosite.io, where ID is of the form,  | 
| 43 | 
            +
                #     expect(out.chomp).to start_with("#{@product_name.downcase}.apps.exosite").and end_with('.io')
         | 
| 44 | 
            +
                #   Now, it's: <ID>.m2.exosite.io, where ID is of the form, 'j41fj45hhk82so0os'
         | 
| 45 45 | 
             
                # Is there an expected length? [lb] has seen {16,17}
         | 
| 46 46 | 
             
                #expect(out.split('.', 2)[0]).to match(/^[a-zA-Z0-9]{16,17}$/)
         | 
| 47 | 
            -
                #expect(out.chomp).to end_with( | 
| 47 | 
            +
                #expect(out.chomp).to end_with('m2.exosite.io')
         | 
| 48 48 | 
             
                out.lines.each do |line|
         | 
| 49 | 
            -
                  expect(line).to match( | 
| 49 | 
            +
                  expect(line).to match(
         | 
| 50 | 
            +
                    %r{^(Product|Application): domain[Tt]est[a-z0-9]+ <[a-z0-9]+> https://[.a-z0-9]+$}
         | 
| 51 | 
            +
                  )
         | 
| 50 52 | 
             
                end
         | 
| 51 53 | 
             
                expect(err).to eq('')
         | 
| 52 54 | 
             
                expect(status.exitstatus).to eq(0)
         | 
    
        data/spec/cmd_exchange_spec.rb
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            # Last Modified: 2017. | 
| 1 | 
            +
            # Last Modified: 2017.09.12 /coding: utf-8
         | 
| 2 2 | 
             
            # frozen_string_literal: true
         | 
| 3 3 |  | 
| 4 4 | 
             
            # Copyright © 2016-2017 Exosite LLC.
         | 
| @@ -107,8 +107,8 @@ RSpec.describe 'murano exchange', :cmd, :needs_password do | |
| 107 107 | 
             
                      element_id = stdout.strip
         | 
| 108 108 | 
             
                      stdout, stderr = murano_command_exits('exchange purchase', element_id)
         | 
| 109 109 | 
             
                      expect(stdout).to eq('')
         | 
| 110 | 
            -
                      expect(stderr).to eq(
         | 
| 111 | 
            -
                        "The specified element has already been purchased:  | 
| 110 | 
            +
                      expect(strip_fancy(stderr)).to eq(
         | 
| 111 | 
            +
                        "The specified element has already been purchased: '#{element_name}' (#{element_id})\n"
         | 
| 112 112 | 
             
                      )
         | 
| 113 113 | 
             
                    end
         | 
| 114 114 | 
             
                  end
         | 
    
        data/spec/cmd_init_spec.rb
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            # Last Modified: 2017. | 
| 1 | 
            +
            # Last Modified: 2017.09.12 /coding: utf-8
         | 
| 2 2 | 
             
            # frozen_string_literal: true
         | 
| 3 3 |  | 
| 4 4 | 
             
            # Copyright © 2016-2017 Exosite LLC.
         | 
| @@ -11,9 +11,9 @@ require 'pathname' | |
| 11 11 | 
             
            require 'cmd_common'
         | 
| 12 12 |  | 
| 13 13 | 
             
            RSpec.describe 'murano init', :cmd do
         | 
| 14 | 
            -
              include_context  | 
| 14 | 
            +
              include_context 'CI_CMD'
         | 
| 15 15 |  | 
| 16 | 
            -
              def  | 
| 16 | 
            +
              def expected_response_when_ids_found_in_config(
         | 
| 17 17 | 
             
                t,
         | 
| 18 18 | 
             
                expect_rebasing: false,
         | 
| 19 19 | 
             
                has_one_each_soln: false,
         | 
| @@ -74,9 +74,9 @@ RSpec.describe 'murano init', :cmd do | |
| 74 74 | 
             
                  ]
         | 
| 75 75 | 
             
                end
         | 
| 76 76 | 
             
                expecting += [
         | 
| 77 | 
            -
                  t.a_string_matching( | 
| 77 | 
            +
                  t.a_string_matching(/Linked '\w+' to '\w+'\n/),
         | 
| 78 78 | 
             
                  "\n",
         | 
| 79 | 
            -
                  t.a_string_matching( | 
| 79 | 
            +
                  t.a_string_matching(/Created default event handler\n/),
         | 
| 80 80 | 
             
                  "\n",
         | 
| 81 81 | 
             
                ]
         | 
| 82 82 | 
             
                if expect_proj_file_write
         | 
| @@ -128,26 +128,26 @@ RSpec.describe 'murano init', :cmd do | |
| 128 128 | 
             
                expecting += [
         | 
| 129 129 | 
             
                  "Success!\n",
         | 
| 130 130 | 
             
                  "\n",
         | 
| 131 | 
            -
                  t.a_string_matching( | 
| 132 | 
            -
                  t.a_string_matching( | 
| 133 | 
            -
                  t.a_string_matching( | 
| 131 | 
            +
                  t.a_string_matching(/\s+Business ID: \w+\n/),
         | 
| 132 | 
            +
                  t.a_string_matching(/(\s+Application ID: \w+\n)?/),
         | 
| 133 | 
            +
                  t.a_string_matching(/(\s+Product ID: \w+\n)?/),
         | 
| 134 134 | 
             
                  "\n",
         | 
| 135 135 | 
             
                ]
         | 
| 136 136 | 
             
                expecting
         | 
| 137 137 | 
             
              end
         | 
| 138 138 |  | 
| 139 | 
            -
              it  | 
| 139 | 
            +
              it %(Won't init in HOME (gracefully)) do
         | 
| 140 140 | 
             
                # this is in the project dir. Want to be in HOME
         | 
| 141 141 | 
             
                Dir.chdir(ENV['HOME']) do
         | 
| 142 142 | 
             
                  out, err, status = Open3.capture3(capcmd('murano', 'init'))
         | 
| 143 | 
            -
                  expect(out).to eq( | 
| 143 | 
            +
                  expect(out).to eq('')
         | 
| 144 144 | 
             
                  expect(err).to eq("\e[31mCannot init a project in your HOME directory.\e[0m\n")
         | 
| 145 145 | 
             
                  expect(status.exitstatus).to eq(2)
         | 
| 146 146 | 
             
                end
         | 
| 147 147 | 
             
              end
         | 
| 148 148 |  | 
| 149 | 
            -
              context  | 
| 150 | 
            -
                context  | 
| 149 | 
            +
              context 'in empty directory', :needs_password do
         | 
| 150 | 
            +
                context 'with' do
         | 
| 151 151 | 
             
                  # Setup a product and application to use.
         | 
| 152 152 | 
             
                  # Doing this in a context with before&after so that after runs even when test
         | 
| 153 153 | 
             
                  # fails.
         | 
| @@ -181,30 +181,30 @@ RSpec.describe 'murano init', :cmd do | |
| 181 181 | 
             
                    expect(status.exitstatus).to eq(0)
         | 
| 182 182 | 
             
                  end
         | 
| 183 183 |  | 
| 184 | 
            -
                  it  | 
| 184 | 
            +
                  it 'existing project' do
         | 
| 185 185 | 
             
                    # The test account will have one business, one product, and one application.
         | 
| 186 186 | 
             
                    # So it won't ask any questions.
         | 
| 187 187 | 
             
                    out, err, status = Open3.capture3(capcmd('murano', 'init'))
         | 
| 188 | 
            -
                    expecting =  | 
| 188 | 
            +
                    expecting = expected_response_when_ids_found_in_config(
         | 
| 189 189 | 
             
                      self,
         | 
| 190 190 | 
             
                      has_one_each_soln: true,
         | 
| 191 191 | 
             
                    )
         | 
| 192 | 
            -
                    out_lines = out.lines.map { |line| line | 
| 192 | 
            +
                    out_lines = out.lines.map { |line| strip_fancy(line) }
         | 
| 193 193 | 
             
                    expect(out_lines).to match_array(expecting)
         | 
| 194 194 | 
             
                    expect(err).to eq('')
         | 
| 195 195 | 
             
                    expect(status.exitstatus).to eq(0)
         | 
| 196 196 |  | 
| 197 | 
            -
                    expect(File.directory?( | 
| 198 | 
            -
                    expect(File.exist?( | 
| 199 | 
            -
                    expect(File.directory?( | 
| 200 | 
            -
                    expect(File.directory?( | 
| 201 | 
            -
                    expect(File.directory?( | 
| 202 | 
            -
                    expect(File.directory?( | 
| 203 | 
            -
                    expect(File.directory?( | 
| 197 | 
            +
                    expect(File.directory?('.murano')).to be true
         | 
| 198 | 
            +
                    expect(File.exist?('.murano/config')).to be true
         | 
| 199 | 
            +
                    expect(File.directory?('routes')).to be true
         | 
| 200 | 
            +
                    expect(File.directory?('services')).to be true
         | 
| 201 | 
            +
                    expect(File.directory?('files')).to be true
         | 
| 202 | 
            +
                    expect(File.directory?('modules')).to be true
         | 
| 203 | 
            +
                    expect(File.directory?('specs')).to be true
         | 
| 204 204 | 
             
                  end
         | 
| 205 205 | 
             
                end
         | 
| 206 206 |  | 
| 207 | 
            -
                context  | 
| 207 | 
            +
                context 'without', :needs_password do
         | 
| 208 208 | 
             
                  before(:example) do
         | 
| 209 209 | 
             
                    murano_solutions_expunge_yes
         | 
| 210 210 | 
             
                    @applctn_name = rname('initCreatingApp')
         | 
| @@ -222,7 +222,7 @@ RSpec.describe 'murano init', :cmd do | |
| 222 222 | 
             
                    expect(status.exitstatus).to eq(0)
         | 
| 223 223 | 
             
                  end
         | 
| 224 224 |  | 
| 225 | 
            -
                  it  | 
| 225 | 
            +
                  it 'existing project' do
         | 
| 226 226 | 
             
                    # The test account will have one business.
         | 
| 227 227 | 
             
                    # It will ask to create an application and product.
         | 
| 228 228 | 
             
                    # MAGIC_NUMBER: !!!! the 8 is hardcoded indention here !!!!
         | 
| @@ -233,12 +233,12 @@ RSpec.describe 'murano init', :cmd do | |
| 233 233 | 
             
                    EOT
         | 
| 234 234 | 
             
                    # 2017-07-05: [lb] added line numbers to use debugger to help maintain this test.
         | 
| 235 235 | 
             
                    out, err, status = Open3.capture3(capcmd('murano', 'init'), stdin_data: data)
         | 
| 236 | 
            -
                    expecting =  | 
| 236 | 
            +
                    expecting = expected_response_when_ids_found_in_config(
         | 
| 237 237 | 
             
                      self,
         | 
| 238 238 | 
             
                      has_no_solutions: true,
         | 
| 239 239 | 
             
                      expect_proj_file_write: true,
         | 
| 240 240 | 
             
                    )
         | 
| 241 | 
            -
                    out_lines = out.lines.map { |line| line | 
| 241 | 
            +
                    out_lines = out.lines.map { |line| strip_fancy(line) }
         | 
| 242 242 | 
             
                    expect(out_lines).to match_array(expecting)
         | 
| 243 243 | 
             
                    #expect(out.lines).to match_array([
         | 
| 244 244 | 
             
                    #  "\n", # 0
         | 
| @@ -258,7 +258,7 @@ RSpec.describe 'murano init', :cmd do | |
| 258 258 | 
             
                    #  "Please enter the Product name: \n", # 14
         | 
| 259 259 | 
             
                    #  a_string_starting_with('Created new Product: '), # 15
         | 
| 260 260 | 
             
                    #  "\n", # 16
         | 
| 261 | 
            -
                    #  a_string_starting_with( | 
| 261 | 
            +
                    #  a_string_starting_with("Linked '"), # 17
         | 
| 262 262 | 
             
                    #  "\n", # 18
         | 
| 263 263 | 
             
                    #  "Created default event handler\n", # 19
         | 
| 264 264 | 
             
                    #  "\n", # 20
         | 
| @@ -273,21 +273,21 @@ RSpec.describe 'murano init', :cmd do | |
| 273 273 | 
             
                    #  a_string_starting_with('          Product ID: '), # 29
         | 
| 274 274 | 
             
                    #  "\n", # 30
         | 
| 275 275 | 
             
                    #])
         | 
| 276 | 
            -
                    expect(err).to eq( | 
| 276 | 
            +
                    expect(err).to eq('')
         | 
| 277 277 | 
             
                    expect(status.exitstatus).to eq(0)
         | 
| 278 278 |  | 
| 279 | 
            -
                    expect(File.directory?( | 
| 280 | 
            -
                    expect(File.exist?( | 
| 281 | 
            -
                    expect(File.directory?( | 
| 282 | 
            -
                    expect(File.directory?( | 
| 283 | 
            -
                    expect(File.directory?( | 
| 284 | 
            -
                    expect(File.directory?( | 
| 285 | 
            -
                    expect(File.directory?( | 
| 279 | 
            +
                    expect(File.directory?('.murano')).to be true
         | 
| 280 | 
            +
                    expect(File.exist?('.murano/config')).to be true
         | 
| 281 | 
            +
                    expect(File.directory?('routes')).to be true
         | 
| 282 | 
            +
                    expect(File.directory?('services')).to be true
         | 
| 283 | 
            +
                    expect(File.directory?('files')).to be true
         | 
| 284 | 
            +
                    expect(File.directory?('modules')).to be true
         | 
| 285 | 
            +
                    expect(File.directory?('specs')).to be true
         | 
| 286 286 | 
             
                  end
         | 
| 287 287 | 
             
                end
         | 
| 288 288 | 
             
              end
         | 
| 289 289 |  | 
| 290 | 
            -
              context  | 
| 290 | 
            +
              context 'in existing project directory', :needs_password do
         | 
| 291 291 | 
             
                before(:example) do
         | 
| 292 292 | 
             
                  murano_solutions_expunge_yes
         | 
| 293 293 |  | 
| @@ -324,11 +324,11 @@ RSpec.describe 'murano init', :cmd do | |
| 324 324 | 
             
                  end
         | 
| 325 325 | 
             
                end
         | 
| 326 326 |  | 
| 327 | 
            -
                it  | 
| 327 | 
            +
                it 'without ProjectFile' do
         | 
| 328 328 | 
             
                  # The test account will have one business, one product, and one application.
         | 
| 329 329 | 
             
                  # So it won't ask any questions.
         | 
| 330 330 | 
             
                  out, err, status = Open3.capture3(capcmd('murano', 'init'))
         | 
| 331 | 
            -
                  the_expected =  | 
| 331 | 
            +
                  the_expected = expected_response_when_ids_found_in_config(
         | 
| 332 332 | 
             
                    self,
         | 
| 333 333 | 
             
                    expect_rebasing: true,
         | 
| 334 334 | 
             
                    creates_some_default_directories: true,
         | 
| @@ -336,26 +336,26 @@ RSpec.describe 'murano init', :cmd do | |
| 336 336 | 
             
                    # murano init *will* download all the event handlers.
         | 
| 337 337 | 
             
                    #local_files_found: true,
         | 
| 338 338 | 
             
                  )
         | 
| 339 | 
            -
                  out_lines = out.lines.map { |line| line | 
| 339 | 
            +
                  out_lines = out.lines.map { |line| strip_fancy(line) }
         | 
| 340 340 | 
             
                  expect(out_lines).to match_array(the_expected)
         | 
| 341 | 
            -
                  expect(err).to eq( | 
| 341 | 
            +
                  expect(err).to eq('')
         | 
| 342 342 | 
             
                  expect(status.exitstatus).to eq(0)
         | 
| 343 343 |  | 
| 344 | 
            -
                  expect(File.directory?( | 
| 345 | 
            -
                  expect(File.exist?( | 
| 346 | 
            -
                  expect(File.directory?( | 
| 347 | 
            -
                  expect(File.directory?( | 
| 348 | 
            -
                  expect(File.directory?( | 
| 349 | 
            -
                  expect(File.directory?( | 
| 350 | 
            -
                  expect(File.directory?( | 
| 344 | 
            +
                  expect(File.directory?('.murano')).to be true
         | 
| 345 | 
            +
                  expect(File.exist?('.murano/config')).to be true
         | 
| 346 | 
            +
                  expect(File.directory?('routes')).to be true
         | 
| 347 | 
            +
                  expect(File.directory?('services')).to be true
         | 
| 348 | 
            +
                  expect(File.directory?('files')).to be true
         | 
| 349 | 
            +
                  expect(File.directory?('modules')).to be true
         | 
| 350 | 
            +
                  expect(File.directory?('specs')).to be true
         | 
| 351 351 | 
             
                end
         | 
| 352 352 |  | 
| 353 | 
            -
                it  | 
| 353 | 
            +
                it 'with ProjectFile' do
         | 
| 354 354 | 
             
                  FileUtils.copy(File.join(@testdir, 'spec/fixtures/ProjectFiles/only_meta.yaml'), 'test.murano')
         | 
| 355 355 | 
             
                  # The test account will have one business, one product, and one application.
         | 
| 356 356 | 
             
                  # So it won't ask any questions.
         | 
| 357 357 | 
             
                  out, err, status = Open3.capture3(capcmd('murano', 'init'))
         | 
| 358 | 
            -
                  expected =  | 
| 358 | 
            +
                  expected = expected_response_when_ids_found_in_config(
         | 
| 359 359 | 
             
                    self,
         | 
| 360 360 | 
             
                    expect_rebasing: true,
         | 
| 361 361 | 
             
                    expect_proj_file_write: false,
         | 
| @@ -364,40 +364,40 @@ RSpec.describe 'murano init', :cmd do | |
| 364 364 | 
             
                    # murano init *will* download all the event handlers.
         | 
| 365 365 | 
             
                    #local_files_found: true,
         | 
| 366 366 | 
             
                  )
         | 
| 367 | 
            -
                  out_lines = out.lines.map { |line| line | 
| 367 | 
            +
                  out_lines = out.lines.map { |line| strip_fancy(line) }
         | 
| 368 368 | 
             
                  expect(out_lines).to match_array(expected)
         | 
| 369 | 
            -
                  expect(err).to eq( | 
| 369 | 
            +
                  expect(err).to eq('')
         | 
| 370 370 | 
             
                  expect(status.exitstatus).to eq(0)
         | 
| 371 371 |  | 
| 372 | 
            -
                  expect(File.directory?( | 
| 373 | 
            -
                  expect(File.exist?( | 
| 374 | 
            -
                  expect(File.directory?( | 
| 375 | 
            -
                  expect(File.directory?( | 
| 376 | 
            -
                  expect(File.directory?( | 
| 377 | 
            -
                  expect(File.directory?( | 
| 378 | 
            -
                  expect(File.directory?( | 
| 372 | 
            +
                  expect(File.directory?('.murano')).to be true
         | 
| 373 | 
            +
                  expect(File.exist?('.murano/config')).to be true
         | 
| 374 | 
            +
                  expect(File.directory?('routes')).to be true
         | 
| 375 | 
            +
                  expect(File.directory?('services')).to be true
         | 
| 376 | 
            +
                  expect(File.directory?('files')).to be true
         | 
| 377 | 
            +
                  expect(File.directory?('modules')).to be true
         | 
| 378 | 
            +
                  expect(File.directory?('specs')).to be true
         | 
| 379 379 | 
             
                end
         | 
| 380 380 |  | 
| 381 | 
            -
                it  | 
| 381 | 
            +
                it 'with SolutionFile 0.2.0' do
         | 
| 382 382 | 
             
                  File.open('Solutionfile.json', 'wb') do |io|
         | 
| 383 383 | 
             
                    io << {
         | 
| 384 | 
            -
                      : | 
| 385 | 
            -
                      : | 
| 386 | 
            -
                      : | 
| 387 | 
            -
                      : | 
| 388 | 
            -
                        : | 
| 384 | 
            +
                      default_page: 'index.html',
         | 
| 385 | 
            +
                      file_dir: 'files',
         | 
| 386 | 
            +
                      custom_api: 'routes/manyRoutes.lua',
         | 
| 387 | 
            +
                      modules: {
         | 
| 388 | 
            +
                        table_util: 'modules/table_util.lua',
         | 
| 389 | 
            +
                      },
         | 
| 390 | 
            +
                      event_handler: {
         | 
| 391 | 
            +
                        device: {
         | 
| 392 | 
            +
                          datapoint: 'services/devdata.lua',
         | 
| 393 | 
            +
                        },
         | 
| 389 394 | 
             
                      },
         | 
| 390 | 
            -
                      :event_handler => {
         | 
| 391 | 
            -
                        :device => {
         | 
| 392 | 
            -
                          :datapoint => 'services/devdata.lua'
         | 
| 393 | 
            -
                        }
         | 
| 394 | 
            -
                      }
         | 
| 395 395 | 
             
                    }.to_json
         | 
| 396 396 | 
             
                  end
         | 
| 397 397 | 
             
                  # The test account will have one business, one product, and one application.
         | 
| 398 398 | 
             
                  # So it won't ask any questions.
         | 
| 399 399 | 
             
                  out, err, status = Open3.capture3(capcmd('murano', 'init'))
         | 
| 400 | 
            -
                  expected =  | 
| 400 | 
            +
                  expected = expected_response_when_ids_found_in_config(
         | 
| 401 401 | 
             
                    self,
         | 
| 402 402 | 
             
                    expect_rebasing: true,
         | 
| 403 403 | 
             
                    creates_some_default_directories: true,
         | 
| @@ -406,41 +406,41 @@ RSpec.describe 'murano init', :cmd do | |
| 406 406 | 
             
                    ##local_files_found_application: true,
         | 
| 407 407 | 
             
                    #local_files_found_product: true,
         | 
| 408 408 | 
             
                  )
         | 
| 409 | 
            -
                  out_lines = out.lines.map { |line| line | 
| 409 | 
            +
                  out_lines = out.lines.map { |line| strip_fancy(line) }
         | 
| 410 410 | 
             
                  expect(out_lines).to match_array(expected)
         | 
| 411 | 
            -
                  expect(err).to eq( | 
| 411 | 
            +
                  expect(err).to eq('')
         | 
| 412 412 | 
             
                  expect(status.exitstatus).to eq(0)
         | 
| 413 413 |  | 
| 414 | 
            -
                  expect(File.directory?( | 
| 415 | 
            -
                  expect(File.exist?( | 
| 416 | 
            -
                  expect(File.directory?( | 
| 417 | 
            -
                  expect(File.directory?( | 
| 418 | 
            -
                  expect(File.directory?( | 
| 419 | 
            -
                  expect(File.directory?( | 
| 420 | 
            -
                  expect(File.directory?( | 
| 414 | 
            +
                  expect(File.directory?('.murano')).to be true
         | 
| 415 | 
            +
                  expect(File.exist?('.murano/config')).to be true
         | 
| 416 | 
            +
                  expect(File.directory?('routes')).to be true
         | 
| 417 | 
            +
                  expect(File.directory?('services')).to be true
         | 
| 418 | 
            +
                  expect(File.directory?('files')).to be true
         | 
| 419 | 
            +
                  expect(File.directory?('modules')).to be true
         | 
| 420 | 
            +
                  expect(File.directory?('specs')).to be true
         | 
| 421 421 | 
             
                end
         | 
| 422 422 |  | 
| 423 | 
            -
                it  | 
| 423 | 
            +
                it 'with SolutionFile 0.3.0' do
         | 
| 424 424 | 
             
                  File.open('Solutionfile.json', 'wb') do |io|
         | 
| 425 425 | 
             
                    io << {
         | 
| 426 | 
            -
                      : | 
| 427 | 
            -
                      : | 
| 428 | 
            -
                      : | 
| 429 | 
            -
                      : | 
| 430 | 
            -
                        : | 
| 426 | 
            +
                      default_page: 'index.html',
         | 
| 427 | 
            +
                      assets: 'files',
         | 
| 428 | 
            +
                      routes: 'routes/manyRoutes.lua',
         | 
| 429 | 
            +
                      modules: {
         | 
| 430 | 
            +
                        table_util: 'modules/table_util.lua',
         | 
| 431 431 | 
             
                      },
         | 
| 432 | 
            -
                      : | 
| 433 | 
            -
                        : | 
| 434 | 
            -
                          : | 
| 435 | 
            -
                        }
         | 
| 432 | 
            +
                      services: {
         | 
| 433 | 
            +
                        device: {
         | 
| 434 | 
            +
                          datapoint: 'services/devdata.lua',
         | 
| 435 | 
            +
                        },
         | 
| 436 436 | 
             
                      },
         | 
| 437 | 
            -
                      : | 
| 437 | 
            +
                      version: '0.3.0',
         | 
| 438 438 | 
             
                    }.to_json
         | 
| 439 439 | 
             
                  end
         | 
| 440 440 | 
             
                  # The test account will have one business, one product, and one application.
         | 
| 441 441 | 
             
                  # So it won't ask any questions.
         | 
| 442 442 | 
             
                  out, err, status = Open3.capture3(capcmd('murano', 'init'))
         | 
| 443 | 
            -
                  expected =  | 
| 443 | 
            +
                  expected = expected_response_when_ids_found_in_config(
         | 
| 444 444 | 
             
                    self,
         | 
| 445 445 | 
             
                    expect_rebasing: true,
         | 
| 446 446 | 
             
                    creates_some_default_directories: true,
         | 
| @@ -449,20 +449,19 @@ RSpec.describe 'murano init', :cmd do | |
| 449 449 | 
             
                    ##local_files_found_application: true,
         | 
| 450 450 | 
             
                    #local_files_found_product: true,
         | 
| 451 451 | 
             
                  )
         | 
| 452 | 
            -
                  out_lines = out.lines.map { |line| line | 
| 452 | 
            +
                  out_lines = out.lines.map { |line| strip_fancy(line) }
         | 
| 453 453 | 
             
                  expect(out_lines).to match_array(expected)
         | 
| 454 | 
            -
                  expect(err).to eq( | 
| 454 | 
            +
                  expect(err).to eq('')
         | 
| 455 455 | 
             
                  expect(status.exitstatus).to eq(0)
         | 
| 456 456 |  | 
| 457 | 
            -
                  expect(File.directory?( | 
| 458 | 
            -
                  expect(File.exist?( | 
| 459 | 
            -
                  expect(File.directory?( | 
| 460 | 
            -
                  expect(File.directory?( | 
| 461 | 
            -
                  expect(File.directory?( | 
| 462 | 
            -
                  expect(File.directory?( | 
| 463 | 
            -
                  expect(File.directory?( | 
| 457 | 
            +
                  expect(File.directory?('.murano')).to be true
         | 
| 458 | 
            +
                  expect(File.exist?('.murano/config')).to be true
         | 
| 459 | 
            +
                  expect(File.directory?('routes')).to be true
         | 
| 460 | 
            +
                  expect(File.directory?('services')).to be true
         | 
| 461 | 
            +
                  expect(File.directory?('files')).to be true
         | 
| 462 | 
            +
                  expect(File.directory?('modules')).to be true
         | 
| 463 | 
            +
                  expect(File.directory?('specs')).to be true
         | 
| 464 464 | 
             
                end
         | 
| 465 465 | 
             
              end
         | 
| 466 | 
            -
             | 
| 467 466 | 
             
            end
         | 
| 468 467 |  |