Sha256: 2926207b516099df574e5213301bb1567169ca520f453f2e141c8e5cdea9875b
Contents?: true
Size: 1.4 KB
Versions: 30
Compression:
Stored size: 1.4 KB
Contents
require File.dirname(__FILE__) + '/../../spec_helper' include PoolParty::Resources describe "Cron" do describe "instances" do before(:each) do @cloud = cloud :cron_resources do cron({:command => "/bin/logrotate"}) end @cron = @cloud.resource(:cron).first end it "should turn the one hash instance into a string" do @cron.to_string.should =~ /'\/bin\/logrotate'/ end it "should turn the two hash instance into a string" do @cron = cron({:name => "mail", :command => "/bin/mail -s \"letters\""}) @cron.to_string.should =~ /"mail":/ end describe "as included" do before(:each) do reset_resources! @cron = cron({:rent => "low"}) do name "/www/conf/httpd.conf" hour 23 minute 5 weekday 1 end end it "should use default values" do @cron.name.should == "/www/conf/httpd.conf" end it "should keep the default values for the cron" do @cron.user.should == "root" end it "should also set options through a hash" do @cron.rent.should == "low" end it "should set the hour to 23" do @cron.hour.should == 23 end it "should set the minute to 5" do @cron.minute.should == 5 end it "should set the weekday to 1" do @cron.weekday.should == 1 end end end end
Version data entries
30 entries across 30 versions & 2 rubygems