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.25.0 spec/type/windows/command_spec.rb
serverspec-2.24.3 spec/type/windows/command_spec.rb
serverspec-2.24.2 spec/type/windows/command_spec.rb
serverspec-2.24.1 spec/type/windows/command_spec.rb
serverspec-2.24.0 spec/type/windows/command_spec.rb
serverspec-2.23.1 spec/type/windows/command_spec.rb
serverspec-2.23.0 spec/type/windows/command_spec.rb
serverspec-2.22.0 spec/type/windows/command_spec.rb
serverspec-2.21.1 spec/type/windows/command_spec.rb
serverspec-2.21.0 spec/type/windows/command_spec.rb
serverspec-2.20.0 spec/type/windows/command_spec.rb
serverspec-2.19.0 spec/type/windows/command_spec.rb
serverspec-2.18.0 spec/type/windows/command_spec.rb
serverspec-2.17.1 spec/type/windows/command_spec.rb
serverspec-2.17.0 spec/type/windows/command_spec.rb
serverspec-2.16.0 spec/type/windows/command_spec.rb
serverspec-2.15.0 spec/type/windows/command_spec.rb
serverspec-2.14.1 spec/type/windows/command_spec.rb
serverspec-2.14.0 spec/type/windows/command_spec.rb
serverspec-2.13.0 spec/type/windows/command_spec.rb