Sha256: 289acb746a909aa43404419180eed1ffd47dcb386caa0f78f9cb944888656699

Contents?: true

Size: 1.38 KB

Versions: 45

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'

include Serverspec::Helper::Solaris

describe command('cat /etc/resolv.conf') do
  let(:stdout) { "nameserver 127.0.0.1\r\n" }
  it { should return_stdout("nameserver 127.0.0.1") }
  its(:command) { should eq 'cat /etc/resolv.conf' }
end

describe 'complete matching of stdout' do
  context command('cat /etc/resolv.conf') do
    let(:stdout) { "foocontent-should-be-includedbar\r\n" }
    it { should_not return_stdout('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" }
    it { should return_stdout(/127\.0\.0\.1/) }
  end
end

describe command('cat /etc/resolv.conf') do
  let(:stdout) { "No such file or directory\r\n" }
  it { should return_stderr("No such file or directory") }
  its(:command) { should eq 'cat /etc/resolv.conf' }
end

describe 'complete matching of stderr' do
  context command('cat /etc/resolv.conf') do
    let(:stdout) { "No such file or directory\r\n" }
    it { should_not return_stdout('file') }
  end
end

describe 'regexp matching of stderr' do
  context command('cat /etc/resolv.conf') do
    let(:stdout) { "No such file or directory\r\n" }
    it { should return_stderr(/file/) }
  end
end

describe command('cat /etc/resolv.conf') do
  it { should return_exit_status 0 }
  its(:command) { should eq 'cat /etc/resolv.conf' }
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
serverspec-0.10.5 spec/solaris/command_spec.rb
serverspec-0.10.4 spec/solaris/command_spec.rb
serverspec-0.10.3 spec/solaris/command_spec.rb
serverspec-0.10.2 spec/solaris/command_spec.rb
serverspec-0.10.1 spec/solaris/command_spec.rb
serverspec-0.10.0 spec/solaris/command_spec.rb
serverspec-0.9.8 spec/solaris/command_spec.rb
serverspec-0.9.7 spec/solaris/command_spec.rb
serverspec-0.9.6 spec/solaris/command_spec.rb
serverspec-0.9.5 spec/solaris/command_spec.rb
serverspec-0.9.4 spec/solaris/command_spec.rb
serverspec-0.9.3 spec/solaris/command_spec.rb
serverspec-0.9.2 spec/solaris/command_spec.rb
serverspec-0.9.1 spec/solaris/command_spec.rb
serverspec-0.9.0 spec/solaris/command_spec.rb
serverspec-0.8.1 spec/solaris/command_spec.rb
serverspec-0.8.0 spec/solaris/command_spec.rb
serverspec-0.7.13 spec/solaris/command_spec.rb
serverspec-0.7.12 spec/solaris/command_spec.rb
serverspec-0.7.11 spec/solaris/command_spec.rb