diff --git a/lib/aruba/processes/basic_process.rb b/lib/aruba/processes/basic_process.rb index 90925d6f8..b6fb2183e 100644 --- a/lib/aruba/processes/basic_process.rb +++ b/lib/aruba/processes/basic_process.rb @@ -121,8 +121,6 @@ def inspect alias to_s inspect - private - def command Shellwords.split(commandline).first end @@ -133,6 +131,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 ad4317ec6..8a0ce233d 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