diff --git a/lib/aruba/processes/basic_process.rb b/lib/aruba/processes/basic_process.rb index c22be3907..0dc5f5112 100644 --- a/lib/aruba/processes/basic_process.rb +++ b/lib/aruba/processes/basic_process.rb @@ -129,8 +129,6 @@ def inspect alias to_s inspect - private - def command Shellwords.split(commandline).first end @@ -141,6 +139,8 @@ def arguments [] end + private + def truncate(string, max_length) return string if string.length <= max_length string[0, max_length - 1] + ' ...' diff --git a/spec/aruba/processes/spawn_process_spec.rb b/spec/aruba/processes/spawn_process_spec.rb index 8ca22da1a..f0de26d3c 100644 --- a/spec/aruba/processes/spawn_process_spec.rb +++ b/spec/aruba/processes/spawn_process_spec.rb @@ -28,6 +28,11 @@ before(:each) { process.stop } context 'when invoked once' do + it 'has the right args' do + expect(process.command).to eq 'ruby' + expect(process.arguments).to eq ['-e', "warn 'yo'"] + end + it { expect(process.stderr).to eq "yo\n" } end