Sha256: 8abfce709cccea77725dc8378d0ff6f886cf62f30e7bb659b51c204f92902dd5
Contents?: true
Size: 826 Bytes
Versions: 15
Compression:
Stored size: 826 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Runner do context '#initialize' do it 'expects a command string' do Runner.new('echo') end end context '#run' do it 'runs a command' do runner = Runner.new('echo') expect { runner.run }.not_to raise_error end it 'fails on error file not found' do runner = Runner.new('asdfasdf asfd') expect { runner.run }.to raise_error RuntimeError end it 'fails on error status code' do runner = Runner.new('exit 1') expect { runner.run }.to raise_error RuntimeError end end context '#result' do it 'returns stdout as array' do runner = Runner.new("echo -E \"hello\nworld\"") expect(runner.result).to eq(["hello", "world"]) end end end
Version data entries
15 entries across 15 versions & 2 rubygems