Remote extra record separator from `sh' task action
This commit is contained in:
parent
347e6f80c7
commit
bf25b05adb
@ -19,11 +19,11 @@ Feature: `sh' task action
|
||||
target 'some_host.test'
|
||||
|
||||
task :some_task do
|
||||
sh '\echo from remote'
|
||||
sh '\echo hello from remote'
|
||||
end
|
||||
"""
|
||||
When I successfully execute the recipe
|
||||
Then the output must contain "from remote"
|
||||
Then the output must contain exactly "hello from remote\n"
|
||||
|
||||
Scenario: aborts on failed command execution
|
||||
Given a recipe with:
|
||||
|
@ -4,7 +4,6 @@ module Producer
|
||||
class ShellCommand < Action
|
||||
def apply
|
||||
remote.execute(arguments.first, output)
|
||||
output.puts
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -12,7 +12,7 @@ module Producer
|
||||
|
||||
case program
|
||||
when 'echo'
|
||||
output << tokens.join(' ')
|
||||
output << tokens.join(' ') << "\n"
|
||||
when 'true'
|
||||
output << ''
|
||||
when 'false'
|
||||
|
@ -15,7 +15,7 @@ module Producer::Core
|
||||
sh.apply
|
||||
end
|
||||
|
||||
it 'writes the returned output with a record separator' do
|
||||
it 'writes the returned output' do
|
||||
sh.apply
|
||||
expect(output).to eq "#{command_args}\n"
|
||||
end
|
||||
|
@ -20,8 +20,8 @@ module Producer::Core
|
||||
context 'dummy echo command' do
|
||||
let(:command) { 'echo some arguments' }
|
||||
|
||||
it 'returns command arguments' do
|
||||
expect(remote.execute(command)).to eq 'some arguments'
|
||||
it 'returns command arguments ended by a record separator' do
|
||||
expect(remote.execute(command)).to eq "some arguments\n"
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user