Sha256: 79d816fd96a3ba0a61eba9caec27cc67ba106c30440b02fc3db4aa21987280cf

Contents?: true

Size: 706 Bytes

Versions: 6

Compression:

Stored size: 706 Bytes

Contents

require 'spec_helper'

describe "Cmds.err" do
  it "gets echo error output" do
    expect( Cmds.err "echo %s 1>&2", "hey there!" ).to eq "hey there!\n"
  end

  it "reads input" do
    expect(
      Cmds.err("ruby -e %{script}", script: "$stderr.puts STDIN.read") {
        "hey there!"
      }
    ).to eq "hey there!\n"
  end
end # Cmds.err

describe "Cmds#err" do
  it "gets echo error output" do
    expect( 
      Cmds::Cmd.new("echo %s 1>&2").err "hey there!"
    ).to eq "hey there!\n"
  end

  it "reads input" do
    expect(
      Cmds::Cmd.new("ruby -e %{script}").
        err(script: "$stderr.puts STDIN.read") {
          "hey there!"
        }
    ).to eq "hey there!\n"
  end
end # Cmds.err

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cmds-0.1.5 spec/cmds/err_spec.rb
cmds-0.1.4 spec/cmds/err_spec.rb
cmds-0.1.3 spec/cmds/err_spec.rb
cmds-0.1.2 spec/cmds/err_spec.rb
cmds-0.1.1 spec/cmds/err_spec.rb
cmds-0.1.0 spec/cmds/err_spec.rb