Sha256: 8d9a71451a78e749bf08365ecf85b9f35a54d9c6ec8de55f8fedb67b93594869

Contents?: true

Size: 1.22 KB

Versions: 73

Compression:

Stored size: 1.22 KB

Contents

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

include PoolParty::Resources

describe "directory" do
  describe "instances" do
    before(:each) do
      @directory = directory({:name => "/etc/apache2/puppetmaster.conf"})
    end
    it "should turn the one hash instance into a string" do
      @directory.to_string.should =~ /"\/etc\/apache2\/puppetmaster\.conf":/
    end
    it "should turn the two hash instance into a string" do
      @directory = directory do
        name "/etc/init.d/puppetmaster"
        owner "redsmith"
      end
      @directory.to_string.should =~ /"\/etc\/init\.d\/puppetmaster":/
    end
    describe "as included" do            
      before(:each) do
        @directory = directory({:rent => "low"}) do
          name "/www/conf/httpd.conf"
        end
      end
      it "should use default values" do
        @directory.name.should == "/www/conf/httpd.conf"
      end
      it "should keep the default values for the directory" do
        @directory.mode.should == 644
      end
      it "should also set options through a hash" do
        @directory.rent.should == "low"
      end
      it "should have ensure set to directory" do
        @directory.ensure.should == "directory"
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 2 rubygems

Version Path
auser-poolparty-0.2.45 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.46 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.47 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.48 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.49 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.5 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.50 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.51 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.52 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.53 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.54 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.55 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.56 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.57 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.58 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.59 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.6 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.60 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.61 spec/poolparty/pool/resources/directory_spec.rb
auser-poolparty-0.2.62 spec/poolparty/pool/resources/directory_spec.rb