Sha256: 06fe66c348bc2e078b908219d2fd82857199ceb85ace6f4daf7960b23baf7e7b

Contents?: true

Size: 509 Bytes

Versions: 195

Compression:

Stored size: 509 Bytes

Contents

require 'spec_helper'

backend = Specinfra::Backend::Exec.new

context 'Output of stdout_handler' do
  subject(:stdout) do
    out = ''
    backend.stdout_handler = Proc.new {|o| out += o }
    backend.run_command('echo foo')
    out
  end

  it { expect(stdout).to eq "foo\n" }
end

context 'Output of stderr_handler' do
  subject(:stderr) do
    err = ''
    backend.stderr_handler = Proc.new {|e| err += e }
    backend.run_command('echo foo 1>&2')
    err
  end

  it { expect(stderr).to eq "foo\n" }
end

Version data entries

195 entries across 195 versions & 3 rubygems

Version Path
specinfra-2.46.0 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.45.0 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.44.8 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.44.7 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.44.6 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.44.5 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.44.4 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.44.3 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.44.2 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.44.1 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.44.0 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.43.11 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-cisco-2.40.2 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.43.10 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.43.9 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.43.8 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.43.7 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.43.6 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.43.5 spec/backend/exec/stdxxx_handler_spec.rb
specinfra-2.43.4 spec/backend/exec/stdxxx_handler_spec.rb