Sha256: 0d9c0031b2a40cdea9d1bbf8abd585671dba3cacce95e9b7a39c91b98471e6e0

Contents?: true

Size: 687 Bytes

Versions: 120

Compression:

Stored size: 687 Bytes

Contents

# encoding: utf-8
require 'spec_helper'
require 'fedux_org_stdlib/command/run_command'

RSpec.describe Command::RunCommand do
  context '#run_command' do
    klass = Class.new do
      include Command::RunCommand
    end

    it 'captures stdout' do
      result = klass.new.run_command('echo hello_world')

      expect(result.stdout.chomp).to eq('hello_world')
    end

    it 'captures stderr' do
      result = klass.new.run_command('echo hello_world >&2')

      expect(result.stderr.chomp).to eq('hello_world')
    end

    it 'captures exit status' do
      result = klass.new.run_command('echo hello_world >&2')

      expect(result.status.exitstatus).to eq(0)
    end
  end
end

Version data entries

120 entries across 120 versions & 1 rubygems

Version Path
fedux_org-stdlib-0.7.17 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.16 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.15 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.14 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.12 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.11 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.10 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.8 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.7 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.6 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.5 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.4 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.3 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.2 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.1 spec/command/run_command_spec.rb
fedux_org-stdlib-0.7.0 spec/command/run_command_spec.rb
fedux_org-stdlib-0.6.54 spec/command/run_command_spec.rb
fedux_org-stdlib-0.6.53 spec/command/run_command_spec.rb
fedux_org-stdlib-0.6.52 spec/command/run_command_spec.rb
fedux_org-stdlib-0.6.51 spec/command/run_command_spec.rb