Sha256: 7757e8e343f90e7ff05466ed717f80d66cc103eb6de7b4293280f294645383c7

Contents?: true

Size: 791 Bytes

Versions: 1

Compression:

Stored size: 791 Bytes

Contents

require 'spec_helper'

describe ShellTastic do
  it "should run a shell command" do
    result = ShellTastic::Command.run("ls -l")
    result.first.fetch(:exitstatus).should eq(0)
  end

  it "should run multiple commands" do
    result = ShellTastic::Command.run("ls -l", "date")
    result.size.should eq(2) 
  end

  it "should run take an array of commands to run" do
    result = ShellTastic::Command.run(["ls -l", "date"])
    result.size.should eq(2) 
  end


  it "should raise a command exception" do
    expect {
    result = ShellTastic::Command.run("lss -l")
    }.to raise_error(ShellTastic::CommandException)
  end

  it "should alert if command is empty or nil" do
    expect {
      ShellTastic::Command.run("")
    }.to raise_error("The command is emtpy or nil")
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shelltastic-0.3.0 spec/shelltastic_spec.rb