Sha256: b2cd0ea259cf5dcccb4e7757ab49469798d6d503afe754549f721567bc19ac7f

Contents?: true

Size: 926 Bytes

Versions: 2

Compression:

Stored size: 926 Bytes

Contents

# encoding: utf-8

RSpec.describe TTY::Command::Printers::Null do
  let(:output) { StringIO.new }

  it "doesn't print command start or exit" do
    printer = TTY::Command::Printers::Null.new(output)
    cmd = TTY::Command::Cmd.new("echo hello")

    printer.print_command_start(cmd)
    printer.print_command_exit(cmd, 0)
    output.rewind

    expect(output.string).to be_empty
  end

  it "doesn't print command stdout data" do
    printer = TTY::Command::Printers::Null.new(output)
    cmd = TTY::Command::Cmd.new("echo hello")

    printer.print_command_out_data(cmd, 'hello', 'world')
    output.rewind

    expect(output.string).to be_empty
  end

  it "doesn't print command stderr data" do
    printer = TTY::Command::Printers::Null.new(output)
    cmd = TTY::Command::Cmd.new("echo hello")

    printer.print_command_err_data(cmd, 'hello', 'world')
    output.rewind

    expect(output.string).to be_empty
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tty-command-0.9.0 spec/unit/printers/null_spec.rb
tty-command-0.8.2 spec/unit/printers/null_spec.rb