require 'spec_helper' set :os, :family => 'base' describe command('cat /etc/resolv.conf') do let(:stdout) { "nameserver 127.0.0.1\r\n" } its(:stdout) { should match /nameserver 127.0.0.1/ } end describe 'complete matching of stdout' do context command('cat /etc/resolv.conf') do let(:stdout) { "foocontent-should-be-includedbar\r\n" } its(:stdout) { should_not eq 'content-should-be-included' } end end describe 'regexp matching of stdout' do context command('cat /etc/resolv.conf') do let(:stdout) { "nameserver 127.0.0.1\r\n" } its(:stdout) { should match /127\.0\.0\.1/ } end end describe command('cat /etc/resolv.conf') do let(:stderr) { "No such file or directory\r\n" } its(:stderr) { should match /No such file or directory/ } end describe 'complete matching of stderr' do context command('cat /etc/resolv.conf') do let(:stderr) { "No such file or directory\r\n" } its(:stdout) { should_not eq 'file' } end end describe 'regexp matching of stderr' do context command('cat /etc/resolv.conf') do let(:stderr) { "No such file or directory\r\n" } its(:stderr) { should match /file/ } end end describe command('cat /etc/resolv.conf') do its(:exit_status) { should eq 0 } end describe command('ls -al /') do let(:stdout) { < include('version' => '0.26.5')) } its(:stdout_as_json) { should include('transport' => include('keepalives' => include('consumers' => 1))) } its(:stdout_as_json) { should include('transport' => include('connected' => true)) } its(:stdout_as_json) { should include('array' => include('title' => 'array 2')) } end