Sha256: de42489e07f5c82e275b9891a72a51b8d16f2f1a0f68a8de97460f59ec62326b

Contents?: true

Size: 1.48 KB

Versions: 22

Compression:

Stored size: 1.48 KB

Contents

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

describe "User" do
  describe "instances" do
    before(:each) do
      @tc = TestBaseClass.new do
        has_user("bob", {:job => "accountant", :comment => "Bob is outstanding"}) do
          password "b0b"
          home "/home/bob"
        end
      end
      @user = @tc.resources[:user].first
    end
    it "have the name in the options" do      
      @user.name.should == "bob"
    end
    it "should store the owner's name" do
      @user.comment.should == "Bob is outstanding"
    end
    it "should store the password (from within the block)" do
      @user.password.should == "b0b"
    end
    it "should store the home" do
      @user.home.should == "/home/bob"
    end
    describe "into PuppetResolver" do
      before(:each) do
        @compiled = PuppetResolver.new(@tc.to_properties_hash).compile
      end
      it "should set the filename to the name of the file" do
        @compiled.should match(/user \{ "bob"/)
      end
      it "set the owner as the owner" do
        # puts "<pre>"+@compiled.to_yaml+"</pre>"
        @compiled.should match(/comment => "Bob is outstanding"/)
      end
      it "should say it's a user in the ensure method" do
        @compiled.should match(/ensure => "present"/)
      end
      it "have the mode set in the puppet output" do
        @compiled.should match(/home => "\/home\/bob"/)
      end
      it "set the password" do
        @compiled.should match(/password => "b0b"/)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
auser-poolparty-1.1.1 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.1.3 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.1.4 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.1.5 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.1.6 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.1.7 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.0 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.1 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.10 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.11 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.12 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.2 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.3 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.4 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.7 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.8 spec/poolparty/resources/user_spec.rb
auser-poolparty-1.2.9 spec/poolparty/resources/user_spec.rb
fairchild-poolparty-1.1.3 spec/poolparty/resources/user_spec.rb
fairchild-poolparty-1.1.4 spec/poolparty/resources/user_spec.rb
fairchild-poolparty-1.1.5 spec/poolparty/resources/user_spec.rb