Sha256: 5aa2fb411d03813ebfea619ca98609485d52ac618544e025f704e8a1fa670151

Contents?: true

Size: 695 Bytes

Versions: 6

Compression:

Stored size: 695 Bytes

Contents

require 'spec_helper'

include Serverspec::Helper::FreeBSD

describe cron do
  it { should have_entry '* * * * * /usr/local/bin/batch.sh' }
  its(:command) { should eq 'crontab -l | grep -- \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ /usr/local/bin/batch.sh' }
end

describe cron do
  it { should_not have_entry 'invalid entry' }
end

describe cron do
  it { should have_entry('* * * * * /usr/local/bin/batch.sh').with_user('root') }
  its(:command) { should eq 'crontab -u root -l | grep -- \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ \\\\\\*\\ /usr/local/bin/batch.sh' }
end

describe cron do
  it { should_not have_entry('* * * * * /usr/local/bin/batch.sh').with_user('invalid-user') }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serverspec-0.11.5 spec/freebsd/cron_spec.rb
serverspec-0.11.4 spec/freebsd/cron_spec.rb
serverspec-0.11.3 spec/freebsd/cron_spec.rb
serverspec-0.11.2 spec/freebsd/cron_spec.rb
serverspec-0.9.4 spec/freebsd/cron_spec.rb
serverspec-0.9.3 spec/freebsd/cron_spec.rb