diff options
Diffstat (limited to 'spec/functional')
-rw-r--r-- | spec/functional/application_spec.rb | 8 | ||||
-rw-r--r-- | spec/functional/knife/smoke_test.rb | 8 | ||||
-rw-r--r-- | spec/functional/mixin/shell_out_spec.rb | 16 | ||||
-rw-r--r-- | spec/functional/resource/file_spec.rb | 12 | ||||
-rw-r--r-- | spec/functional/resource/windows_package_spec.rb | 15 |
5 files changed, 29 insertions, 30 deletions
diff --git a/spec/functional/application_spec.rb b/spec/functional/application_spec.rb index fe656dca60..4d24549696 100644 --- a/spec/functional/application_spec.rb +++ b/spec/functional/application_spec.rb @@ -47,10 +47,10 @@ describe Chef::Application do it "saves built proxy to ENV which shell_out can use" do so = if windows? - shell_out("echo %http_proxy%") - else - shell_out("echo $http_proxy") - end + shell_out("echo %http_proxy%") + else + shell_out("echo $http_proxy") + end expect(so.stdout.chomp).to eq("http://proxy.example.org:8080") end diff --git a/spec/functional/knife/smoke_test.rb b/spec/functional/knife/smoke_test.rb index 607e8065cf..b718bc50e0 100644 --- a/spec/functional/knife/smoke_test.rb +++ b/spec/functional/knife/smoke_test.rb @@ -31,4 +31,12 @@ describe "knife smoke tests" do knife_cmd.error! expect(knife_cmd.stdout).to include(Chef::VERSION) end + + it "can run and show help" do + knife_path = File.expand_path("../../bin/knife", CHEF_SPEC_DATA) + knife_cmd = Mixlib::ShellOut.new("#{knife_path} --help") + knife_cmd.run_command + knife_cmd.error! + expect(knife_cmd.stdout).to include("Usage") + end end diff --git a/spec/functional/mixin/shell_out_spec.rb b/spec/functional/mixin/shell_out_spec.rb index 35e5b30eae..8f8b54414a 100644 --- a/spec/functional/mixin/shell_out_spec.rb +++ b/spec/functional/mixin/shell_out_spec.rb @@ -24,10 +24,10 @@ describe Chef::Mixin::ShellOut do describe "when environment['LC_ALL'] is not set" do it "should use the default shell_out setting" do cmd = if windows? - shell_out_with_systems_locale('echo %LC_ALL%') - else - shell_out_with_systems_locale('echo $LC_ALL') - end + shell_out_with_systems_locale('echo %LC_ALL%') + else + shell_out_with_systems_locale('echo $LC_ALL') + end expect(cmd.stdout.chomp).to match_environment_variable('LC_ALL') end @@ -36,10 +36,10 @@ describe Chef::Mixin::ShellOut do describe "when environment['LC_ALL'] is set" do it "should use the option's setting" do cmd = if windows? - shell_out_with_systems_locale('echo %LC_ALL%', :environment => {'LC_ALL' => 'POSIX'}) - else - shell_out_with_systems_locale('echo $LC_ALL', :environment => {'LC_ALL' => 'POSIX'}) - end + shell_out_with_systems_locale('echo %LC_ALL%', :environment => {'LC_ALL' => 'POSIX'}) + else + shell_out_with_systems_locale('echo $LC_ALL', :environment => {'LC_ALL' => 'POSIX'}) + end expect(cmd.stdout.chomp).to eq 'POSIX' end diff --git a/spec/functional/resource/file_spec.rb b/spec/functional/resource/file_spec.rb index 9e30e62111..861bc65363 100644 --- a/spec/functional/resource/file_spec.rb +++ b/spec/functional/resource/file_spec.rb @@ -1,6 +1,6 @@ # # Author:: Seth Chisamore (<schisamo@opscode.com>) -# Copyright:: Copyright (c) 2011 Opscode, Inc. +# Copyright:: Copyright (c) 2011-2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,11 +31,11 @@ describe Chef::Resource::File do run_context = Chef::RunContext.new(node, {}, events) use_path = if opts[:use_relative_path] - Dir.chdir(Dir.tmpdir) - File.basename(path) - else - path - end + Dir.chdir(Dir.tmpdir) + File.basename(path) + else + path + end Chef::Resource::File.new(use_path, run_context) end diff --git a/spec/functional/resource/windows_package_spec.rb b/spec/functional/resource/windows_package_spec.rb index f5fdc9ef3d..957f357846 100644 --- a/spec/functional/resource/windows_package_spec.rb +++ b/spec/functional/resource/windows_package_spec.rb @@ -37,11 +37,11 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do new_resource end - describe "multi package scenario" do + describe "install package" do let(:pkg_name) { 'Microsoft Visual C++ 2005 Redistributable' } + let(:pkg_checksum) { 'd6832398e3bc9156a660745f427dc1c2392ce4e9a872e04f41f62d0c6bae07a8' } let(:pkg_path) { 'https://download.microsoft.com/download/6/B/B/6BB661D6-A8AE-4819-B79F-236472F6070C/vcredist_x86.exe' } let(:pkg_checksum) { nil } - let(:pkg_version) { '8.0.59193' } let(:pkg_type) { :custom } let(:pkg_options) { "/Q" } @@ -57,6 +57,7 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do context "installing additional version" do let(:pkg_path) { 'https://download.microsoft.com/download/e/1/c/e1c773de-73ba-494a-a5ba-f24906ecf088/vcredist_x86.exe' } + let(:pkg_checksum) { 'eb00f891919d4f894ab725b158459db8834470c382dc60cd3c3ee2c6de6da92c' } let(:pkg_version) { '8.0.56336' } it "installs older version" do @@ -127,11 +128,6 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do let(:pkg_path) { 'http://iweb.dl.sourceforge.net/project/ultradefrag/stable-release/6.1.1/ultradefrag-6.1.1.bin.amd64.exe' } let(:pkg_checksum) { '11d53ed4c426c8c867ad43f142b7904226ffd9938c02e37086913620d79e3c09' } - it "finds the correct package version" do - subject.run_action(:install) - expect(subject.version).to eq('6.1.1') - end - it "finds the correct installer type" do subject.run_action(:install) expect(subject.provider_for_action(:install).installer_type).to eq(:nsis) @@ -143,11 +139,6 @@ describe Chef::Resource::WindowsPackage, :windows_only, :volatile do let(:pkg_path) { 'http://mercurial.selenic.com/release/windows/Mercurial-3.6.1-x64.exe' } let(:pkg_checksum) { 'febd29578cb6736163d232708b834a2ddd119aa40abc536b2c313fc5e1b5831d' } - it "finds the correct package version" do - subject.run_action(:install) - expect(subject.version).to eq(nil) # Mercurial does not include versioning - end - it "finds the correct installer type" do subject.run_action(:install) expect(subject.provider_for_action(:install).installer_type).to eq(:inno) |