summaryrefslogtreecommitdiff
path: root/spec/mixlib/shellout
Commit message (Collapse)AuthorAgeFilesLines
* chefstyleLamont Granquist2020-08-241-2/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix the helper spec testLamont Granquist2020-08-241-0/+11
| | | | | | | not pulling in mixlib-log as a test dep, but just monkeypatching a trace level into the ruby logger Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix a few typosspellingTim Smith2020-07-281-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* chefstyleLamont Granquist2020-07-161-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* this API isn't supported in 2.2Lamont Granquist2020-07-161-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add a simple smoke testlcg/extract-mixlib-shelloutLamont Granquist2020-07-161-0/+30
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Support array args on windowslcg/win-array-argsLamont Granquist2019-06-061-0/+84
| | | | | | | | | | | | | | | | | | | | | | Implements correct quoting and escaping of arguments on windows. That means that this works right now: ```ruby filename = "c:\program files" shell_out("dir", filename); ``` So all the defensive coding around quotes-around-filepaths -- which were all actually buggy even when they worked (trailing backslashes would fail) -- are unnecessary and arguments can just be passed in as an array and this code will sort it out. We rely on the existing determination of if metacharacters mean it needs to run under cmd and if it needs the ^ quoting which seems to be well tested, and which all runs after this does. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Update the github links in commentsTim Smith2018-10-231-5/+5
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* spec cleanup and some light refactoringlcg/cleanup2Lamont Granquist2017-02-011-176/+131
| | | | | | | | | | | | | | | - mostly cleans up the windows specs so its easier to read the API out of them and removes some of the very brittle internal testing - refactors the 'which' logic a bit. trying to converge towards the chef/chef version and eventually extracting common code so that do not have to maintain 10+ slightly different copies everywhere. - adds the Mixlib::ShellOut::EmptyWindowsCommand exception because letting CreateProcessW throw a generic SystemCallError is pretty much useless to everyone. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* remove largely useless Utils classLamont Granquist2017-01-271-11/+10
| | | | | | | | its just a collection of private methods, they should be private methods retain a method in the class that was being used externally. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Resolve most chefstyle warningsTim Smith2016-10-071-72/+72
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* add logging message if attempting to kill critical processsmurawski/agressive_terminationSteven Murawski2016-06-061-5/+7
|
* Keep `kill_process_tree` from killing protected system processes.Steven Murawski2016-05-241-3/+43
|
* prevent shellout from attempting to execute a directory on windowsMatt Wrock2015-09-111-0/+2
|
* have failing testMatt Wrock2015-09-111-0/+29
|
* rspec3ificationLamont Granquist2015-05-151-105/+105
|
* Add tests for running as different user in windowsMoser, Kevin2013-01-221-1/+1
|
* [RSPEC] Use Rspec 3 metadataHo-Sheng Hsiao2012-05-101-1/+1
|
* [CHEF-2994][WINDOWS] Added edge cases to specs for Utils.should_run_under_cmd?()Ho-Sheng Hsiao2012-05-101-0/+50
|
* [CHEF-2994][WINDOWS] Expanded Utils.should_run_under_cmd?() to work like ↵Ho-Sheng Hsiao2012-05-101-16/+44
| | | | Ruby system()
* [CHEF-2994][WINDOWS] Fixed Utils.which()Ho-Sheng Hsiao2012-05-101-0/+30
| | | | - Factored out Utils.should_run_under_cmd? (simple case)
* [CHEF-2994][RSPEC] Fixed specs to run under UnixHo-Sheng Hsiao2012-05-101-1/+1
| | | | Ignore Windows unit test
* [CHEF-2994][WINDOWS] Factored out utility methods to ↵Ho-Sheng Hsiao2012-05-101-2/+3
| | | | Mixlib::ShellOut::Windows::Utils
* [CHEF-2994][WINDOWS] Added specs for valid exe at location with unquoted exeHo-Sheng Hsiao2012-05-101-0/+25
|
* [CHEF-2994][WINDOWS] Added specs for empty commandHo-Sheng Hsiao2012-05-101-0/+9
|
* [CHEF-2994][WINDOWS] Added unit tests for invalid batch filesHo-Sheng Hsiao2012-05-101-0/+10
|
* [CHEF-2994][WINDOWS] Added unit tests for valid batch filesHo-Sheng Hsiao2012-05-101-0/+17
|
* [CHEF-2994][WINDOWS] Added unit tests for private method #command_to_runHo-Sheng Hsiao2012-05-101-0/+113
| | | | | | Fixed bug with quoted .cmd files Fixed bug with finding .bat in the middle of the filename
* [RSPEC] Moved shellout_spec up to make room for unit testsHo-Sheng Hsiao2012-05-101-922/+0
|
* [CHEF-2994][WINDOWS] Fixed multiple quotes for non batch filesHo-Sheng Hsiao2012-05-101-0/+18
|
* [CHEF-2994][WINDOWS] Fixed multiple quotes in commandHo-Sheng Hsiao2012-05-101-9/+23
| | | | | | | CMD.exe does not parse multiple quotes well unless the whole thing is wrapped up in quotes. Workaround: https://github.com/opscode/mixlib-shellout/pull/2#issuecomment-4837859 http://ss64.com/nt/syntax-esc.html
* [CHEF-2994][WINDOWS] Disable stdin specs for windows platformHo-Sheng Hsiao2012-03-281-5/+5
|
* [CHEF-2994][RB192] Turn off rubygems for child ruby processesHo-Sheng Hsiao2012-03-281-4/+8
| | | | Sometimes, gems are not sane and trigger deprecation notice. Rather than dealing with that, we disable gems completely.
* [CHEF-2994][RB187] Got specs passing for Ruby 1.8.7 (Linux)Ho-Sheng Hsiao2012-03-271-4/+6
|
* [CHEF-2994][RSPEC] ShellOut#run_command when subprocess pauses before ↵Ho-Sheng Hsiao2012-03-261-0/+12
| | | | reading input should not hang or lose output
* [CHEF-2994][RSPEC] ShellOut#run_command when subprocess closes prematurely ↵Ho-Sheng Hsiao2012-03-261-0/+13
| | | | with input should raise broken pipe exception
* [CHEF-2994][RSPEC] ShellOut#run_command when exiting with invalid code with ↵Ho-Sheng Hsiao2012-03-261-0/+13
| | | | input data shuld handle exit code gracefully
* [CHEF-2994][RSPEC] ShellOut#run_command when execution fails with input ↵Ho-Sheng Hsiao2012-03-261-0/+9
| | | | should recover the error message
* [CHEF-2994][RSPEC] ShellOut#run_command with subprocess that pipes lots of ↵Ho-Sheng Hsiao2012-03-261-0/+24
| | | | data through stdin, stdout, and stderr should not hang
* [CHEF-2994][RSPEC] ShellOut#run_command with subprocess that reads lots of ↵Ho-Sheng Hsiao2012-03-261-0/+12
| | | | data from stdin should not hang
* [CHEF-2994][RSPEC] ShellOut#run_command with subprocess that closes stdin ↵Ho-Sheng Hsiao2012-03-261-0/+9
| | | | and continues writing to stdout should not hang or lose output
* [CHEF-2994][STDIN] Child process should accept stdin input if input is specifiedHo-Sheng Hsiao2012-03-261-0/+13
|
* [CHEF-2994][STDIN] ShellOut.new should accept input as an optionHo-Sheng Hsiao2012-03-261-2/+7
|
* [CHEF-2994][STDIN] ShellOut#input should set the input optionHo-Sheng Hsiao2012-03-261-0/+10
|
* [CHEF-2994][STDIN] Option :input should be set to nil by defaultHo-Sheng Hsiao2012-03-261-0/+1
|
* [CHEF-2994][RSPEC] ShellOut should be able to handle commands with stdin ↵Ho-Sheng Hsiao2012-03-261-1/+22
| | | | file pipes
* [RSPEC] Consolidated mini-dsl globallyHo-Sheng Hsiao2012-03-231-32/+41
| | | | Made things more consistent.
* [RSPEC] Consolidated / dry up let(:ruby_code)Ho-Sheng Hsiao2012-03-231-20/+14
|
* [RSPEC/DOC] Clarified comments about windows evironmental localeHo-Sheng Hsiao2012-03-231-3/+1
|
* [RSPEC] Refactored spec for #format_for_exceptionHo-Sheng Hsiao2012-03-231-11/+18
|