Sha256: fc7469dfcddbf799d37d8df48c88582faf922cbc05855b6fc8e7f79acba7ffe3

Contents?: true

Size: 1.79 KB

Versions: 86

Compression:

Stored size: 1.79 KB

Contents

require 'spec_helper'

set :backend, :cmd
set :os, :family => 'windows'

describe command('test_cmd /test/path/file') do
  let(:stdout) { "test output 1.2.3\r\n" }
  its(:stdout) { should match /test output 1.2.3/ }
end

describe 'complete matching of stdout' do
  context command('test_cmd /test/path/file') 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('test_cmd /test/path/file') do
    let(:stdout) { "test output 1.2.3\r\n" }
    its(:stdout) { should match /1\.2\.3/ }
  end
end

describe command('test_cmd /test/path/file') 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('test_cmd /test/path/file') do
    let(:stderr) { "No such file or directory\r\n" }
    its(:stderr) { should_not eq 'file' }
  end
end

describe 'regexp matching of stderr' do
  context command('test_cmd /test/path/file') do
    let(:stderr) { "No such file or directory\r\n" }
    its(:stderr) { should match /file/ }
  end
end

describe command('test_cmd /test/path/file') do
  its(:exit_status) { should eq 0 }
end

describe command('dir "c:\"') do
  let(:stdout) { <<EOF
    Directory: C:\

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d-r--        23/09/2013  10:46 AM            Program Files
d-r--        23/09/2013   1:21 PM            Program Files (x86)
d----        17/10/2013   8:46 PM            temp
d-r--        23/09/2013  11:52 AM            Users
d----        23/09/2013   1:21 PM            Windows
EOF
    }

  its(:stdout) { should match /Program Files/ }
  its(:stdout) { should eq stdout }
end

Version data entries

86 entries across 86 versions & 4 rubygems

Version Path
serverspec-2.12.0 spec/type/windows/command_spec.rb
serverspec-2.11.0 spec/type/windows/command_spec.rb
serverspec-2.10.2 spec/type/windows/command_spec.rb
serverspec-2.10.1 spec/type/windows/command_spec.rb
serverspec-2.10.0 spec/type/windows/command_spec.rb
serverspec-2.9.1 spec/type/windows/command_spec.rb
serverspec-2.9.0 spec/type/windows/command_spec.rb
serverspec-2.8.2 spec/type/windows/command_spec.rb
serverspec-2.8.1 spec/type/windows/command_spec.rb
serverspec-2.8.0 spec/type/windows/command_spec.rb
serverspec-2.7.2 spec/type/windows/command_spec.rb
serverspec-2.7.1 spec/type/windows/command_spec.rb
serverspec-2.7.0 spec/type/windows/command_spec.rb
serverspec-2.6.0 spec/type/windows/command_spec.rb
serverspec-2.5.0 spec/type/windows/command_spec.rb
serverspec-2.4.0 spec/type/windows/command_spec.rb
serverspec-2.3.1 spec/type/windows/command_spec.rb
serverspec-2.3.0 spec/type/windows/command_spec.rb
serverspec-2.2.0 spec/type/windows/command_spec.rb
serverspec-clc-2.1.0 spec/type/windows/command_spec.rb