Remote extra record separator from `sh' task action

This commit is contained in:
Thibault Jouan 2014-03-05 06:40:18 +00:00
parent 347e6f80c7
commit bf25b05adb
5 changed files with 6 additions and 7 deletions

View File

@ -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:

View File

@ -4,7 +4,6 @@ module Producer
class ShellCommand < Action
def apply
remote.execute(arguments.first, output)
output.puts
end
end
end

View File

@ -12,7 +12,7 @@ module Producer
case program
when 'echo'
output << tokens.join(' ')
output << tokens.join(' ') << "\n"
when 'true'
output << ''
when 'false'

View File

@ -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

View File

@ -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