=> :define do context 'manage the users' do myuser = { 'testuser' => {'groups' => {'testgroup1' => '', 'testgroup2' => '' } } } describe 'ensure that the user and home directory exists' do let(:title) { "user exists" } let(:params) {{ 'user' => myuser }} let(:facts) {{ :osfamily => 'Debian' }} it { should compile.with_all_deps } it { should contain_user('testuser').with( 'groups' => ['testgroup1', 'testgroup2'] )} end end end
do context 'windows feature should be installed' do it 'should install .net 3.5 feature' do pp = <<-PP windowsfeature { 'as-net-framework': } PP apply_manifest(pp, :catch_failures => true) expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero end describe windows_feature('as-net-framework') do it { should be_installed.by('powershell') } end end end First windows test
of UAC' do $key = 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' describe windows_registry_key($key) do it { should have_property_value('EnableLUA', :type_dword, '0x00000000') } end end Other Examples require 'spec_helper_acceptance' context 'Installation of McAfee Agent' do describe package('McAfee Agent') do it { should be_installed } end describe service('McAfee Framework Service') do it { should be_running } it { should have_start_mode('Automatic') } end end