Sha256: 6e55f933032d587154fc8126ebaee254511487778a5774d574a6ed4f36a95e2a

Contents?: true

Size: 603 Bytes

Versions: 1

Compression:

Stored size: 603 Bytes

Contents

require File.dirname(__FILE__) + '/../test'

module Cotta
describe CommandRunner do
  it 'return content' do
    runner = CommandRunner.new('ruby --version')
    runner.execute[0..3].should == 'ruby'
  end
  
  it 'raise error on abnormal exits' do
    runner = CommandRunner.new('ruby ----')
    Proc.new{runner.execute}.should raise_error(CommandError)
  end
  
  it 'take closure as io processor' do
    runner = CommandRunner.new('echo test')
    message_logged = nil
    runner.execute {|io| message_logged = io.gets}
    message_logged.should == "test\n"
  end
  
end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cotta-1.0.0 test/cotta/command_runner_spec.rb