Sha256: 38303ef265d7dd79b0e10159b186721ac9bb9bf2bf2614b266aae490de21e829

Contents?: true

Size: 1.04 KB

Versions: 8

Compression:

Stored size: 1.04 KB

Contents

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

include PoolParty::Resources

describe "User" do
  describe "instances" do
    before(:each) do
      @user = remote_user({:name => "fred"})
    end
    it "should turn the one hash instance into a string" do
      @user.to_string.should =~ /"fred":/
    end
    it "should turn the two hash instance into a string" do
      @user = remote_user do
        name "bob"
        home "/home/bob"
      end
      @user.to_string.should =~ /"bob":/
      @user.to_string.should =~ /home => '\/home\/bob'/
    end
    describe "as included" do            
      before(:each) do
        @user = remote_user({:rent => "low"}) do
          name "/www/conf/httpd.conf"
        end
      end
      it "should use default values" do
        @user.name.should == "/www/conf/httpd.conf"
      end
      it "should keep the default values for the user" do
        @user.shell.should == "/bin/sh"
      end
      it "should also set options through a hash" do
        @user.rent.should == "low"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
auser-poolparty-0.2.80 spec/poolparty/poolparty/resources/user_spec.rb
auser-poolparty-0.2.81 spec/poolparty/poolparty/resources/user_spec.rb
auser-poolparty-0.2.84 spec/poolparty/poolparty/resources/user_spec.rb
auser-poolparty-0.2.85 spec/poolparty/poolparty/resources/user_spec.rb
auser-poolparty-0.2.88 spec/poolparty/poolparty/resources/user_spec.rb
auser-poolparty-0.2.89 spec/poolparty/poolparty/resources/user_spec.rb
auser-poolparty-0.2.90 spec/poolparty/poolparty/resources/user_spec.rb
poolparty-0.2.84 spec/poolparty/poolparty/resources/user_spec.rb