Sha256: 57f172c2f52926d8cc20cbc79df92d8883b6ba0b870e3452515da3e196c840f4

Contents?: true

Size: 1.4 KB

Versions: 73

Compression:

Stored size: 1.4 KB

Contents

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

include PoolParty::Resources

describe "Service" do
  before(:each) do
    reset_resources!
    @service = PoolParty::Resources::Service.new
  end
  describe "instances" do
    before(:each) do
      @service = service({:name => "/etc/apache2/puppetmaster.conf"})
    end
    it "should turn the one hash instance into a string" do
      @service.to_string.should =~ /"\/etc\/apache2\/puppetmaster\.conf":/
    end
    it "should turn the two hash instance into a string" do
      @service = service({:name => "/etc/init.d/puppetmaster"})
      @service.to_string.should =~ /"\/etc\/init\.d\/puppetmaster":/
    end
    describe "as included" do            
      before(:each) do
        reset_resources!
        @service = service({:rent => "low", :ensure => "stopped"}) do
          name "mdmdp"
        end
      end
      it "should use default values" do
        @service.name.should == "mdmdp"
      end
      it "should keep the default values for the Service" do
        @service.enable.should == true
      end
      it "should also set options through a hash" do
        @service.rent.should == "low"
      end
      it "should also set options through a hash" do
        @service.ensure.should == "stopped"
      end
      it "should set ensure as a default if it's not passed" do
        service(:name => "romp").ensure.should == "running"
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 2 rubygems

Version Path
auser-poolparty-0.2.15 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.16 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.20 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.21 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.22 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.23 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.24 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.25 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.26 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.3 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.35 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.36 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.37 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.38 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.39 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.4 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.40 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.41 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.42 spec/poolparty/pool/resources/service_spec.rb
auser-poolparty-0.2.44 spec/poolparty/pool/resources/service_spec.rb