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.38.0 spec/type/windows/command_spec.rb
serverspec-2.37.2 spec/type/windows/command_spec.rb
serverspec-2.37.1 spec/type/windows/command_spec.rb
serverspec-2.37.0 spec/type/windows/command_spec.rb
serverspec-2.36.1 spec/type/windows/command_spec.rb
serverspec-2.36.0 spec/type/windows/command_spec.rb
serverspec-2.35.0 spec/type/windows/command_spec.rb
serverspec-2.34.0 spec/type/windows/command_spec.rb
serverspec-2.33.0 spec/type/windows/command_spec.rb
serverspec-2.32.0 spec/type/windows/command_spec.rb
serverspec-2.31.1 spec/type/windows/command_spec.rb
serverspec-2.31.0 spec/type/windows/command_spec.rb
serverspec-2.30.1 spec/type/windows/command_spec.rb
serverspec-2.30.0 spec/type/windows/command_spec.rb
serverspec-2.29.2 spec/type/windows/command_spec.rb
serverspec-2.29.1 spec/type/windows/command_spec.rb
serverspec-2.29.0 spec/type/windows/command_spec.rb
serverspec-2.28.0 spec/type/windows/command_spec.rb
serverspec-2.27.0 spec/type/windows/command_spec.rb
serverspec-2.26.0 spec/type/windows/command_spec.rb