Sha256: 264e47d3883c868b152a7b357b3dae5add4a0f4810d6d92e19fd3259da04bbcd

Contents?: true

Size: 470 Bytes

Versions: 18

Compression:

Stored size: 470 Bytes

Contents

require 'spec_helper'

describe "Cmds::assert" do
  it "should raise an error when the command fails" do
    expect{ Cmds.assert "exit 1" }.to raise_error Errno::EPERM
  end

  it "should do the same for Cmds!" do
    expect{ Cmds! "exit 1" }.to raise_error Errno::EPERM
  end

  it "should be chainable when the command is ok" do
    expect( Cmds!("echo hey").out ).to eq "hey\n"
    expect( Cmds.new("echo hey").capture.assert.out ).to eq "hey\n"
  end
end # Cmds::run

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
cmds-0.2.11 spec/cmds/assert_spec.rb
cmds-0.2.10 spec/cmds/assert_spec.rb
cmds-0.2.9 spec/cmds/assert_spec.rb
cmds-0.2.8 spec/cmds/assert_spec.rb
cmds-0.2.7 spec/cmds/assert_spec.rb
cmds-0.2.6 spec/cmds/assert_spec.rb
cmds-0.2.5 spec/cmds/assert_spec.rb
cmds-0.2.4 spec/cmds/assert_spec.rb
cmds-0.2.3 spec/cmds/assert_spec.rb
cmds-0.2.2 spec/cmds/assert_spec.rb
cmds-0.2.1 spec/cmds/assert_spec.rb
cmds-0.2.0 spec/cmds/assert_spec.rb
cmds-0.0.9 spec/cmds/assert_spec.rb
cmds-0.0.8 spec/cmds/assert_spec.rb
cmds-0.0.7 spec/cmds/assert_spec.rb
cmds-0.0.6 spec/cmds/assert_spec.rb
cmds-0.0.5 spec/cmds/assert_spec.rb
cmds-0.0.4 spec/cmds/assert_spec.rb