summaryrefslogtreecommitdiff
path: root/spec/functional
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-01-15 10:27:12 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-01-15 10:27:12 -0800
commited9098eda1c9362b5e3f1d0664843c8ceedbafce (patch)
tree5f94564fb3e2f8181ff7791e5607d4e827eff673 /spec/functional
parentc0e4c98ed9630edda0d2285897a7dc6af57e26b7 (diff)
downloadchef-ed9098eda1c9362b5e3f1d0664843c8ceedbafce.tar.gz
fix chefstyle failures
autocorrects some merges that will be broken when the next chefstyle is released. also runs chefstyle after the travis tests, because i'd rather know how the code is broken rather than how its not pretty.
Diffstat (limited to 'spec/functional')
-rw-r--r--spec/functional/resource/chocolatey_package_spec.rb62
1 files changed, 31 insertions, 31 deletions
diff --git a/spec/functional/resource/chocolatey_package_spec.rb b/spec/functional/resource/chocolatey_package_spec.rb
index ad9025420b..201ab3238c 100644
--- a/spec/functional/resource/chocolatey_package_spec.rb
+++ b/spec/functional/resource/chocolatey_package_spec.rb
@@ -15,8 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-require 'spec_helper'
-require 'chef/mixin/powershell_out'
+require "spec_helper"
+require "chef/mixin/powershell_out"
describe Chef::Resource::ChocolateyPackage, :windows_only do
include Chef::Mixin::PowershellOut
@@ -25,97 +25,97 @@ describe Chef::Resource::ChocolateyPackage, :windows_only do
powershell_out("iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))")
end
- let(:package_name) { 'test-A' }
+ let(:package_name) { "test-A" }
let(:package_list) { proc { powershell_out("choco list -lo -r #{Array(package_name).join(' ')}").stdout.chomp } }
- let(:package_source) { File.join(CHEF_SPEC_ASSETS, 'chocolatey_feed') }
+ let(:package_source) { File.join(CHEF_SPEC_ASSETS, "chocolatey_feed") }
subject do
- new_resource = Chef::Resource::ChocolateyPackage.new('test choco package', run_context)
+ new_resource = Chef::Resource::ChocolateyPackage.new("test choco package", run_context)
new_resource.package_name package_name
new_resource.source package_source if package_source
new_resource
end
- context 'installing a package' do
+ context "installing a package" do
after { Chef::Resource::ChocolateyPackage.new(package_name, run_context).run_action(:remove) }
- it 'installs the latest version' do
+ it "installs the latest version" do
subject.run_action(:install)
expect(package_list.call).to eq("#{package_name}|2.0")
end
- it 'does not install if already installed' do
+ it "does not install if already installed" do
subject.run_action(:install)
subject.run_action(:install)
expect(subject).not_to be_updated_by_last_action
end
- it 'installs version given' do
- subject.version '1.0'
+ it "installs version given" do
+ subject.version "1.0"
subject.run_action(:install)
expect(package_list.call).to eq("#{package_name}|1.0")
end
- it 'installs new version if one is already installed' do
- subject.version '1.0'
+ it "installs new version if one is already installed" do
+ subject.version "1.0"
subject.run_action(:install)
expect(package_list.call).to eq("#{package_name}|1.0")
- subject.version '2.0'
+ subject.version "2.0"
subject.run_action(:install)
expect(package_list.call).to eq("#{package_name}|2.0")
end
- context 'installing multiple packages' do
- let(:package_name) { [ 'test-A', 'test-B' ] }
+ context "installing multiple packages" do
+ let(:package_name) { [ "test-A", "test-B" ] }
- it 'installs both packages' do
+ it "installs both packages" do
subject.run_action(:install)
expect(package_list.call).to eq("test-A|2.0\r\ntest-B|1.0")
end
end
- it 'raises if package is not found' do
- subject.package_name 'blah'
+ it "raises if package is not found" do
+ subject.package_name "blah"
expect{ subject.run_action(:install) }.to raise_error Chef::Exceptions::Package
end
- it 'raises if package version is not found' do
- subject.version '3.0'
+ it "raises if package version is not found" do
+ subject.version "3.0"
expect{ subject.run_action(:install) }.to raise_error Chef::Exceptions::Package
- end
+ end
end
- context 'upgrading a package' do
+ context "upgrading a package" do
after { Chef::Resource::ChocolateyPackage.new(package_name, run_context).run_action(:remove) }
- it 'upgrades to a specific version' do
- subject.version '1.0'
+ it "upgrades to a specific version" do
+ subject.version "1.0"
subject.run_action(:install)
expect(package_list.call).to eq("#{package_name}|1.0")
- subject.version '1.5'
+ subject.version "1.5"
subject.run_action(:upgrade)
expect(package_list.call).to eq("#{package_name}|1.5")
end
- it 'upgrades to the latest version if no version given' do
- subject.version '1.0'
+ it "upgrades to the latest version if no version given" do
+ subject.version "1.0"
subject.run_action(:install)
expect(package_list.call).to eq("#{package_name}|1.0")
- subject2 = Chef::Resource::ChocolateyPackage.new('test-A', run_context)
+ subject2 = Chef::Resource::ChocolateyPackage.new("test-A", run_context)
subject2.source package_source
subject2.run_action(:upgrade)
expect(package_list.call).to eq("#{package_name}|2.0")
end
end
- context 'removing a package' do
- it 'removes an installed package' do
+ context "removing a package" do
+ it "removes an installed package" do
subject.run_action(:install)
Chef::Resource::ChocolateyPackage.new(package_name, run_context).run_action(:remove)
- expect(package_list.call).to eq('')
+ expect(package_list.call).to eq("")
end
end
end \ No newline at end of file