:class do it { should include_class('ntp') } it do should contain_file('ntp::config').with({ :ensure => 'present', :path => '/etc/ntp.conf' }) end context "with ensure => absent" do let(:params) { {:ensure => 'absent'} } it { should contain_package('ntp').with_ensure('absent') } it { should_not contain_service('ntp') } it { should contain_file('ntp::config').with_ensure('absent') } end end
....F...................................................................... Failures: 1) ntp with discard => 'average 3 minimum 1' Failure/Error: it { should contain_file('ntp::config').with_content(content) } expected that the catalogue would contain File[ntp::config] with content matching `/discard average 3 minimum 1\n/` but its value of `"discard !!BROKEN!! average 3 minimum 1\n"` does not # ./spec/classes/ntp_spec.rb:30:in `block (3 levels) in <top (required)>' Finished in 3.54 seconds 75 examples, 1 failure Failed examples: rspec ./spec/classes/ntp_spec.rb:30 # ntp with discard => 'average 3 minimum 1'
do it { should include_class('ntp') } it do should contain_package('redis-server').with({ :ensure => 'present' }) end it do should contain_file('/etc/redis.config').with({ :ensure => 'present', :source => 'puppet:///redis/config' }) end it do should contain_service('redis-server').with({ :ensure => 'running' }) end end
when memory size is needed, it is possible to specify # it in the usual form of 1k 5GB 4M and so forth: # # 1k => 1000 bytes # 1kb => 1024 bytes # 1m => 1000000 bytes # 1mb => 1024*1024 bytes # 1g => 1000000000 bytes # 1gb => 1024*1024*1024 bytes # # units are case insensitive so 1GB 1Gb 1gB are all the same. # By default Redis does not run as a daemon. Use 'yes' if you need it. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. daemonize no # When running daemonized, Redis writes a pid file in /var/run/redis.pid by # default. You can specify a custom pid file location here.