|
122 | 122 | end |
123 | 123 |
|
124 | 124 | it "skips caching checks when using content-disposition" do |
125 | | - expect(install_script).to include('if test "x$use_content_disposition" = "xtrue"; then') |
| 125 | + expect(install_script).to include('if [ "$use_content_disposition" = "true" ]; then') |
126 | 126 | expect(install_script).to include('cached_file_available="false"') |
127 | 127 | end |
128 | 128 |
|
|
162 | 162 | end |
163 | 163 |
|
164 | 164 | it "skips caching checks when using content-disposition" do |
165 | | - expect(install_script).to include('if test "x$use_content_disposition" = "xtrue"; then') |
| 165 | + expect(install_script).to include('if [ "$use_content_disposition" = "true" ]; then') |
166 | 166 | expect(install_script).to include('cached_file_available="false"') |
167 | 167 | end |
168 | 168 | end |
|
192 | 192 | end |
193 | 193 |
|
194 | 194 | it "skips caching checks when using content-disposition" do |
195 | | - expect(install_script).to include('if test "x$use_content_disposition" = "xtrue"; then') |
| 195 | + expect(install_script).to include('if [ "$use_content_disposition" = "true" ]; then') |
196 | 196 | expect(install_script).to include('cached_file_available="false"') |
197 | 197 | end |
198 | 198 |
|
|
270 | 270 | end |
271 | 271 |
|
272 | 272 | it "includes chef-ice conditional logic" do |
273 | | - expect(install_script).to include('if test "$project" = "chef-ice"') |
| 273 | + expect(install_script).to include('if [ "$project" = "chef-ice" ]; then') |
274 | 274 | end |
275 | 275 |
|
276 | 276 | it "includes RPM-based platform detection" do |
|
299 | 299 | end |
300 | 300 |
|
301 | 301 | it "constructs chef-ice metadata URL with m, p, pm parameters" do |
302 | | - expect(install_script).to include('metadata_url="$base_api_url/$channel/$project/metadata?v=$version&license_id=$license_id&m=$machine&p=$platform_param&pm=$package_manager"') |
| 302 | + expect(install_script).to include('metadata_url="$base_api_url/$channel/$project/metadata?license_id=$license_id&v=$version&m=$machine&p=$platform_param&pm=$package_manager"') |
303 | 303 | end |
304 | 304 |
|
305 | 305 | it "uses commercial API endpoint" do |
|
315 | 315 | end |
316 | 316 |
|
317 | 317 | it "includes chef-ice conditional logic" do |
318 | | - expect(install_script).to include('if test "$project" = "chef-ice"') |
| 318 | + expect(install_script).to include('if [ "$project" = "chef-ice" ]; then') |
319 | 319 | end |
320 | 320 |
|
321 | 321 | it "constructs chef-ice metadata URL with m, p, pm parameters" do |
322 | | - expect(install_script).to include('metadata_url="$base_api_url/$channel/$project/metadata?v=$version&license_id=$license_id&m=$machine&p=$platform_param&pm=$package_manager"') |
| 322 | + expect(install_script).to include('metadata_url="$base_api_url/$channel/$project/metadata?license_id=$license_id&v=$version&m=$machine&p=$platform_param&pm=$package_manager"') |
323 | 323 | end |
324 | 324 |
|
325 | 325 | it "uses trial API endpoint" do |
|
329 | 329 | it "works with trial- prefix" do |
330 | 330 | add_options[:license_id] = "trial-abc-456" |
331 | 331 | expect(install_script).to include("https://chefdownload-trial.chef.io") |
332 | | - expect(install_script).to include('if test "$project" = "chef-ice"') |
| 332 | + expect(install_script).to include('if [ "$project" = "chef-ice" ]; then') |
333 | 333 | end |
334 | 334 | end |
335 | 335 |
|
|
473 | 473 | it_behaves_like "the correct ps1 script" |
474 | 474 |
|
475 | 475 | it "includes chef-ice conditional logic" do |
476 | | - expect(install_script).to include("if ($project -eq 'chef-ice' -and $license_id)") |
| 476 | + expect(install_script).to include("if ($project -eq 'chef-ice')") |
477 | 477 | end |
478 | 478 |
|
479 | 479 | it "includes simplified parameters for chef-ice on Windows" do |
|
482 | 482 | end |
483 | 483 |
|
484 | 484 | it "constructs chef-ice metadata URL with m, p, pm parameters" do |
485 | | - expect(install_script).to include('$metadata_array = ("?v=$($version)"') |
| 485 | + expect(install_script).to include('$metadata_array = (') |
| 486 | + expect(install_script).to include('"?v=$($version)"') |
486 | 487 | expect(install_script).to include('"license_id=$license_id"') |
487 | 488 | expect(install_script).to include('"m=$architecture"') |
488 | 489 | end |
|
503 | 504 | it_behaves_like "the correct ps1 script" |
504 | 505 |
|
505 | 506 | it "includes chef-ice conditional logic" do |
506 | | - expect(install_script).to include("if ($project -eq 'chef-ice' -and $license_id)") |
| 507 | + expect(install_script).to include("if ($project -eq 'chef-ice')") |
507 | 508 | end |
508 | 509 |
|
509 | 510 | it "includes simplified parameters for chef-ice on Windows" do |
|
665 | 666 | end |
666 | 667 |
|
667 | 668 | it "includes checksum verification check" do |
668 | | - expect(install_script).to match(/if test "x\$sha256" = "x"; then/) |
| 669 | + expect(install_script).to match(/if \[ -z "\$sha256" \]; then/) |
669 | 670 | end |
670 | 671 | end |
671 | 672 | end |
|
0 commit comments