vagrant-hypconfigmgmt 0.0.9 → 0.0.10
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/Makefile +1 -1
- data/README.md +1 -1
- data/lib/vagrant-hypconfigmgmt/command.rb +3 -3
- data/lib/vagrant-hypconfigmgmt/version.rb +1 -1
- data/pkg/vagrant-hypconfigmgmt-0.0.9.gem +0 -0
- data/spec/unit/command/ensure_vagrant_box_type_configured_spec.rb +214 -127
- data/spec/unit/command/get_options_string_spec.rb +1 -1
- data/spec/unit/command/get_php_version_spec.rb +30 -15
- metadata +4 -4
- data/pkg/vagrant-hypconfigmgmt-0.0.8.gem +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 90bd5ff306b35e2bf425db3939e780bb8dff0595
         | 
| 4 | 
            +
              data.tar.gz: 10aae1e915a238463a352c479d67cbca95b11075
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 270c7ebde3ea17f028c7094aed595ab3838a4c3546beeb4099e71e64496e570d725a026935019774f818fa7d7a112b5f9ca4ffa63338b88ef8ca70d47d2c56c4
         | 
| 7 | 
            +
              data.tar.gz: bc95f48e4f18e6b55a7bef4c1b7cae959d3353f6be006f3e6a27912f8756bffe082534d6a57a29472047088a0a29dedf2ff77464772b4cebe535e9d8c3cab3c0
         | 
    
        data/Makefile
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    
| @@ -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'] | 
| 296 | 
            -
                      env[:ui].warning("The Precise Hypernodes don't have  | 
| 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']
         | 
| 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 | 
            -
             | 
| 34 | 
            +
                    expected_settings = { 
         | 
| 35 35 | 
             
                      "ubuntu_version" => "precise",
         | 
| 36 36 | 
             
                      "php" => { 
         | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 | 
            -
             | 
| 43 | 
            -
             | 
| 44 | 
            -
             | 
| 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 | 
            -
             | 
| 47 | 
            -
             | 
| 48 | 
            -
             | 
| 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 | 
            -
             | 
| 57 | 
            +
                    expected_settings = { 
         | 
| 57 58 | 
             
                      "ubuntu_version" => "precise",
         | 
| 58 59 | 
             
                      "php" => { 
         | 
| 59 | 
            -
             | 
| 60 | 
            -
             | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 63 | 
            -
             | 
| 64 | 
            -
             | 
| 65 | 
            -
             | 
| 66 | 
            -
             | 
| 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 | 
            -
             | 
| 69 | 
            -
             | 
| 70 | 
            -
             | 
| 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 | 
            -
             | 
| 80 | 
            +
                    expected_settings = { 
         | 
| 79 81 | 
             
                      "ubuntu_version" => "xenial",
         | 
| 80 82 | 
             
                      "php" => { 
         | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 83 | 
            -
             | 
| 84 | 
            -
             | 
| 85 | 
            -
             | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 | 
            -
             | 
| 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 | 
            -
             | 
| 91 | 
            -
             | 
| 92 | 
            -
             | 
| 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 | 
            -
             | 
| 103 | 
            +
                    expected_settings = { 
         | 
| 101 104 | 
             
                      "ubuntu_version" => "precise",
         | 
| 102 105 | 
             
                      "php" => { 
         | 
| 103 | 
            -
             | 
| 104 | 
            -
             | 
| 105 | 
            -
             | 
| 106 | 
            -
             | 
| 107 | 
            -
             | 
| 108 | 
            -
             | 
| 109 | 
            -
             | 
| 110 | 
            -
             | 
| 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 | 
            -
             | 
| 113 | 
            -
             | 
| 114 | 
            -
             | 
| 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 | 
            -
             | 
| 126 | 
            +
                    expected_settings = { 
         | 
| 123 127 | 
             
                      "ubuntu_version" => "precise",
         | 
| 124 128 | 
             
                      "php" => { 
         | 
| 125 | 
            -
             | 
| 126 | 
            -
             | 
| 127 | 
            -
             | 
| 128 | 
            -
             | 
| 129 | 
            -
             | 
| 130 | 
            -
             | 
| 131 | 
            -
             | 
| 132 | 
            -
             | 
| 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 | 
            -
             | 
| 135 | 
            -
             | 
| 136 | 
            -
             | 
| 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 | 
            -
             | 
| 149 | 
            +
                    expected_settings = { 
         | 
| 145 150 | 
             
                      "ubuntu_version" => "xenial",
         | 
| 146 151 | 
             
                      "php" => { 
         | 
| 147 | 
            -
             | 
| 148 | 
            -
             | 
| 149 | 
            -
             | 
| 150 | 
            -
             | 
| 151 | 
            -
             | 
| 152 | 
            -
             | 
| 153 | 
            -
             | 
| 154 | 
            -
             | 
| 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 | 
            -
             | 
| 157 | 
            -
             | 
| 158 | 
            -
             | 
| 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 | 
            -
             | 
| 172 | 
            +
                    expected_settings = { 
         | 
| 167 173 | 
             
                      "ubuntu_version" => "precise",
         | 
| 168 174 | 
             
                      "php" => { 
         | 
| 169 | 
            -
             | 
| 170 | 
            -
             | 
| 171 | 
            -
             | 
| 175 | 
            +
                        "version" => 5.5
         | 
| 176 | 
            +
                      },
         | 
| 177 | 
            +
                      "vagrant" => { 
         | 
| 172 178 | 
             
                        # Falling back to php5.5, Precise Hypernodes have no PHP5.6
         | 
| 173 | 
            -
             | 
| 174 | 
            -
             | 
| 175 | 
            -
             | 
| 176 | 
            -
             | 
| 177 | 
            -
             | 
| 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 | 
            -
             | 
| 180 | 
            -
             | 
| 181 | 
            -
             | 
| 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 | 
            -
             | 
| 184 | 
            -
             | 
| 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 | 
            -
             | 
| 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 | 
            -
             | 
| 196 | 
            -
             | 
| 197 | 
            -
             | 
| 198 | 
            -
             | 
| 199 | 
            -
             | 
| 200 | 
            -
             | 
| 201 | 
            -
             | 
| 202 | 
            -
             | 
| 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 | 
            -
             | 
| 205 | 
            -
             | 
| 206 | 
            -
             | 
| 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 | 
            -
             | 
| 209 | 
            -
             | 
| 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 | 
            -
             | 
| 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 | 
            -
             | 
| 220 | 
            -
             | 
| 221 | 
            -
             | 
| 222 | 
            -
             | 
| 223 | 
            -
             | 
| 224 | 
            -
             | 
| 225 | 
            -
             | 
| 226 | 
            -
             | 
| 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 | 
            -
             | 
| 229 | 
            -
             | 
| 230 | 
            -
             | 
| 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 | 
            -
             | 
| 233 | 
            -
             | 
| 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 | 
            -
             | 
| 326 | 
            +
                    expected_settings = { 
         | 
| 241 327 | 
             
                      "ubuntu_version" => "precise",
         | 
| 242 328 | 
             
                      "php" => { 
         | 
| 243 | 
            -
             | 
| 244 | 
            -
             | 
| 245 | 
            -
             | 
| 246 | 
            -
             | 
| 247 | 
            -
             | 
| 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 | 
            -
             | 
| 250 | 
            -
             | 
| 251 | 
            -
             | 
| 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 | 
            -
             | 
| 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 | 
            -
             | 
| 262 | 
            -
             | 
| 263 | 
            -
             | 
| 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 | 
            -
             | 
| 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 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
             | 
| 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 | 
            -
             | 
| 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 | 
            -
             | 
| 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 | 
            -
             | 
| 46 | 
            -
             | 
| 47 | 
            -
             | 
| 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 | 
            -
             | 
| 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 | 
            -
             | 
| 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 | 
            -
             | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 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 | 
            -
             | 
| 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. | 
| 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:  | 
| 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. | 
| 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 |