Sha256: 943c78e0ff06e5c53f8dba017fc81d20feda445304e6580367b7db3f54e73370

Contents?: true

Size: 693 Bytes

Versions: 4

Compression:

Stored size: 693 Bytes

Contents

require 'spec_helper'

include Serverspec::Helper::Plamo

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

4 entries across 4 versions & 1 rubygems

Version Path
serverspec-0.11.5 spec/plamo/cron_spec.rb
serverspec-0.11.4 spec/plamo/cron_spec.rb
serverspec-0.11.3 spec/plamo/cron_spec.rb
serverspec-0.11.2 spec/plamo/cron_spec.rb