Skip to content

Commit

Permalink
master of chefstyle + fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Jul 6, 2018
1 parent 274f04d commit 0a4fb40
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/mixlib/shellout/version.rb
@@ -1,5 +1,5 @@
module Mixlib
class ShellOut
VERSION = "2.3.2"
VERSION = "2.3.2".freeze
end
end
8 changes: 4 additions & 4 deletions spec/mixlib/shellout_spec.rb
Expand Up @@ -353,13 +353,13 @@
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
Expand Down Expand Up @@ -1378,7 +1378,7 @@ def ruby_wo_shell(code)
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} }
Expand Down Expand Up @@ -1540,7 +1540,7 @@ def ruby_wo_shell(code)
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
Expand Down
8 changes: 4 additions & 4 deletions spec/support/platform_helpers.rb
Expand Up @@ -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?
Expand Down

0 comments on commit 0a4fb40

Please sign in to comment.