Sha256: 3cc4f7adf1d4f57bf9fb3d27d2854b938a06cd30894d17067609d771357ab52b
Contents?: true
Size: 833 Bytes
Versions: 10
Compression:
Stored size: 833 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("ruby -e 'puts \"hello\nworld\"'") expect(runner.result).to eq(["hello", "world"]) end end end
Version data entries
10 entries across 10 versions & 1 rubygems