Skip to content

Commit

Permalink
Test command and arguments for SpawnProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Nov 9, 2017
1 parent 2edea61 commit 18d38a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/aruba/processes/basic_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ def inspect

alias to_s inspect

private

def command
Shellwords.split(commandline).first
end
Expand All @@ -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] + ' ...'
Expand Down
5 changes: 5 additions & 0 deletions spec/aruba/processes/spawn_process_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 18d38a8

Please sign in to comment.