Sha256: bd964e9aecf175e782fb6ba58eaf156e8a5ffb3b44e8f11c329f7daddb54f913

Contents?: true

Size: 693 Bytes

Versions: 26

Compression:

Stored size: 693 Bytes

Contents

require 'spec_helper'

include SpecInfra::Helper::Darwin

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

26 entries across 26 versions & 1 rubygems

Version Path
serverspec-0.13.4 spec/darwin/cron_spec.rb
serverspec-0.13.3 spec/darwin/cron_spec.rb
serverspec-0.13.2 spec/darwin/cron_spec.rb
serverspec-0.13.1 spec/darwin/cron_spec.rb
serverspec-0.13.0 spec/darwin/cron_spec.rb
serverspec-0.12.0 spec/darwin/cron_spec.rb