Sha256: 152c09b3a181885df41414146549b4dfc5a85d73f49a7817eba5052a73e3b7a0

Contents?: true

Size: 787 Bytes

Versions: 1

Compression:

Stored size: 787 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("Command is emtpy or nil")
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shelltastic-0.2.5 spec/shelltastic_spec.rb