Sha256: c6cdcc0a48563c65ad69404c2ad1c98f828da48d9ed53012ca95e3f781a9f14e

Contents?: true

Size: 1.2 KB

Versions: 56

Compression:

Stored size: 1.2 KB

Contents

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

include PoolParty::Resources

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

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
auser-poolparty-0.2.35 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.36 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.37 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.38 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.39 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.40 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.41 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.42 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.44 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.45 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.46 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.47 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.48 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.49 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.50 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.51 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.52 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.53 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.54 spec/poolparty/pool/resources/remote_file_spec.rb
auser-poolparty-0.2.55 spec/poolparty/pool/resources/remote_file_spec.rb