diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-01-12 11:48:47 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-01-12 11:48:47 -0800 |
commit | 29f39ec8045e159aebb15d583314d8d3d746e345 (patch) | |
tree | ed5f451d48d9847b0ce13ec99824dfb34aab8e26 /spec/unit | |
parent | 8778f46bf800f3cc9b6e4ba2a014cb04e06925c5 (diff) | |
parent | 6610ebd39d19c3b8776d69a56a39c3b496b8b29f (diff) | |
download | chef-29f39ec8045e159aebb15d583314d8d3d746e345.tar.gz |
Merge pull request #4384 from chef/lcg/really-fix-cops
really fix cops
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/application/knife_spec.rb | 10 | ||||
-rw-r--r-- | spec/unit/knife/cookbook_site_install_spec.rb | 14 | ||||
-rw-r--r-- | spec/unit/provider/package/rubygems_spec.rb | 16 |
3 files changed, 21 insertions, 19 deletions
diff --git a/spec/unit/application/knife_spec.rb b/spec/unit/application/knife_spec.rb index 8894e86240..0fb25176f9 100644 --- a/spec/unit/application/knife_spec.rb +++ b/spec/unit/application/knife_spec.rb @@ -1,6 +1,6 @@ # # Author:: AJ Christensen (<aj@junglist.gen.nz>) -# Copyright:: Copyright (c) 2008 Opscode, Inc. +# Copyright:: Copyright (c) 2008-2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -104,10 +104,10 @@ describe Chef::Application::Knife do it "does not expand a full path" do full_path = if windows? - 'C:/chef/client.pem' - else - '/etc/chef/client.pem' - end + 'C:/chef/client.pem' + else + '/etc/chef/client.pem' + end with_argv(*%W{noop knife command -k #{full_path}}) do expect(@knife).to receive(:exit).with(0) @knife.run diff --git a/spec/unit/knife/cookbook_site_install_spec.rb b/spec/unit/knife/cookbook_site_install_spec.rb index 07b268bb64..9779de4a64 100644 --- a/spec/unit/knife/cookbook_site_install_spec.rb +++ b/spec/unit/knife/cookbook_site_install_spec.rb @@ -1,6 +1,6 @@ # # Author:: Steven Danna (<steve@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"); @@ -26,11 +26,13 @@ describe Chef::Knife::CookbookSiteInstall do let(:repo) { double(:sanity_check => true, :reset_to_default_state => true, :prepare_to_import => true, :finalize_updates_to => true, :merge_updates_from => true) } - let(:install_path) { if Chef::Platform.windows? - 'C:/tmp/chef' - else - '/var/tmp/chef' - end } + let(:install_path) { + if Chef::Platform.windows? + 'C:/tmp/chef' + else + '/var/tmp/chef' + end + } before(:each) do require 'chef/knife/core/cookbook_scm_repo' diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb index f790bdb1ce..5e4d8a6224 100644 --- a/spec/unit/provider/package/rubygems_spec.rb +++ b/spec/unit/provider/package/rubygems_spec.rb @@ -223,10 +223,10 @@ describe Chef::Provider::Package::Rubygems::AlternateGemEnvironment do it "determines the installed versions of gems from the source index (part2: the unmockening)" do allow($stdout).to receive(:write) path_to_gem = if windows? - `where gem`.split[1] - else - `which gem`.strip - end + `where gem`.split[1] + else + `which gem`.strip + end skip("cant find your gem executable") if path_to_gem.empty? gem_env = Chef::Provider::Package::Rubygems::AlternateGemEnvironment.new(path_to_gem) expected = ['rspec-core', Gem::Version.new(RSpec::Core::Version::STRING)] @@ -261,7 +261,7 @@ RubyGems Environment: - REMOTE SOURCES: - https://rubygems.org/ - http://gems.github.com/ -JRUBY_GEM_ENV + JRUBY_GEM_ENV expect(@gem_env).to receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(double('jruby_gem_env', :stdout => gem_env_out)) expected = ['ruby', Gem::Platform.new('universal-java-1.6')] expect(@gem_env.gem_platforms).to eq(expected) @@ -303,7 +303,7 @@ RubyGems Environment: - REMOTE SOURCES: - https://rubygems.org/ - http://gems.github.com/ -RBX_GEM_ENV + RBX_GEM_ENV expect(@gem_env).to receive(:shell_out!).with('/usr/weird/bin/gem env').and_return(double('rbx_gem_env', :stdout => gem_env_out)) expect(@gem_env.gem_platforms).to eq(Gem.platforms) expect(Chef::Provider::Package::Rubygems::AlternateGemEnvironment.platform_cache['/usr/weird/bin/gem']).to eq(Gem.platforms) @@ -459,8 +459,8 @@ describe Chef::Provider::Package::Rubygems do @provider.current_resource.version('0.0.1') version = Gem::Version.new(@spec_version) expect(@provider.gem_env).to receive(:candidate_version_from_remote). - with(Gem::Dependency.new('rspec-core', @spec_version), "http://mygems.example.com"). - and_return(version) + with(Gem::Dependency.new('rspec-core', @spec_version), "http://mygems.example.com"). + and_return(version) expect(@provider.candidate_version).to eq(@spec_version) end |