diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-06 13:32:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 13:32:11 -0700 |
commit | b94ede6401acc708401101e3d0858b03b17125a8 (patch) | |
tree | 6c462f25706e297ea2312ba13459047cdf994ee1 | |
parent | 274f04da4fcf70ff47251926de407de8120db1c3 (diff) | |
parent | 0a4fb406a268de6aec6eba5653e7c67c3b06b670 (diff) | |
download | mixlib-shellout-b94ede6401acc708401101e3d0858b03b17125a8.tar.gz |
Merge pull request #161 from chef/lcg/chefstyle2
master of chefstyle + fixes
-rw-r--r-- | Gemfile | 1 | ||||
-rw-r--r-- | lib/mixlib/shellout/version.rb | 2 | ||||
-rw-r--r-- | spec/mixlib/shellout_spec.rb | 8 | ||||
-rw-r--r-- | spec/support/platform_helpers.rb | 8 |
4 files changed, 10 insertions, 9 deletions
@@ -3,6 +3,7 @@ source "https://rubygems.org" gemspec name: "mixlib-shellout" group(:test) do + gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "master" gem "rspec_junit_formatter" gem "rake" end diff --git a/lib/mixlib/shellout/version.rb b/lib/mixlib/shellout/version.rb index 3b473fe..d2f2262 100644 --- a/lib/mixlib/shellout/version.rb +++ b/lib/mixlib/shellout/version.rb @@ -1,5 +1,5 @@ module Mixlib class ShellOut - VERSION = "2.3.2" + VERSION = "2.3.2".freeze end end diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index 3867a9d..ceb80d9 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -353,13 +353,13 @@ describe Mixlib::ShellOut do context "when setting user by id" do before(:each) { shell_cmd.user = uid } # Setting the user by uid should change the uid - #it 'should set the uid' do + # it 'should set the uid' do describe "#uid" do subject { super().uid } it { is_expected.to eq(uid) } end - #end + # end # Setting the user without a different gid should change the gid to 1002 describe "#gid" do @@ -1378,7 +1378,7 @@ describe Mixlib::ShellOut do end context "with subprocess writing lots of data to both stdout and stderr" do - let(:expected_output_with) { lambda { |chr| (chr * 20_000) + "#{LINE_ENDING}" + (chr * 20_000) + "#{LINE_ENDING}" } } + let(:expected_output_with) { lambda { |chr| (chr * 20_000) + (LINE_ENDING).to_s + (chr * 20_000) + (LINE_ENDING).to_s } } context "when writing to STDOUT first" do let(:ruby_code) { %q{puts "f" * 20_000; STDERR.puts "u" * 20_000; puts "f" * 20_000; STDERR.puts "u" * 20_000} } @@ -1540,7 +1540,7 @@ describe Mixlib::ShellOut do let(:options) { { user: user } } it "should run as specified user" do - expect(running_user).to eql("#{user}") + expect(running_user).to eql((user).to_s) end end end diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb index bbf7d15..25e17f1 100644 --- a/spec/support/platform_helpers.rb +++ b/spec/support/platform_helpers.rb @@ -9,11 +9,11 @@ def unix? end if windows? - LINE_ENDING = "\r\n" - ECHO_LC_ALL = "echo %LC_ALL%" + LINE_ENDING = "\r\n".freeze + ECHO_LC_ALL = "echo %LC_ALL%".freeze else - LINE_ENDING = "\n" - ECHO_LC_ALL = "echo $LC_ALL" + LINE_ENDING = "\n".freeze + ECHO_LC_ALL = "echo $LC_ALL".freeze end def root? |