Sha256: b2224798e92783c6d0889adf2c4520350aae9a927646d17e37a7c9d987c08f9e

Contents?: true

Size: 1.33 KB

Versions: 22

Compression:

Stored size: 1.33 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe "cron" do
  describe "instances" do
    before(:each) do
      @tc = TestBaseClass.new do
        has_cron("mail stats") do
          command "mail -s httpd.conf ari@poolpartyrb.com"
          hour 23
          minute 5
          weekday 1
        end
      end
      @cron = @tc.resource(:cron).first
    end
    it "have the name in the options" do
      @cron.name.should == "mail stats"
    end
    it "should store the owner's name as well" do
      @cron.command.should == "mail -s httpd.conf ari@poolpartyrb.com"
    end
    it "should store the time (from within the block)" do
      @cron.hour.should == 23
      @cron.minute.should == 5
      @cron.weekday.should == 1
    end
    describe "into PuppetResolver" do
      before(:each) do
        @compiled = PuppetResolver.new(@tc.to_properties_hash).compile
      end
      it "should set the cronname to the name of the cron" do
        @compiled.should match(/cron \{ "mail stats"/)
      end
      it "set the command" do
        @compiled.should match(/command => "mail -s httpd\.conf ari@poolpartyrb\.com"/)
      end
      it "have the time set in the puppet output" do
        @compiled.should match(/hour => 23/)
        @compiled.should match(/minute => 5/)
        @compiled.should match(/weekday => 1/)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
auser-poolparty-1.1.1 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.1.3 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.1.4 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.1.5 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.1.6 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.1.7 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.0 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.1 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.10 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.11 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.12 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.2 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.3 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.4 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.7 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.8 spec/poolparty/resources/cron_spec.rb
auser-poolparty-1.2.9 spec/poolparty/resources/cron_spec.rb
fairchild-poolparty-1.1.3 spec/poolparty/resources/cron_spec.rb
fairchild-poolparty-1.1.4 spec/poolparty/resources/cron_spec.rb
fairchild-poolparty-1.1.5 spec/poolparty/resources/cron_spec.rb