Sha256: 4f5237928e731cd55f6d690a756c5e7d637f16af2fd427d4850ef0cfe5621ba0

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 KB

Contents

require File.expand_path("../../spec_helper", File.dirname(__FILE__))

describe Sprinkle::Installers::User do

  before do
    @package = mock(Sprinkle::Package, :name => 'spec')
    @user = "bob"
  end

  def create_user(name, options = {}, &block)
    Sprinkle::Installers::User.new "spec", name, options, &block
  end

  describe 'during installation' do
    
    it "should invoke add user" do
      @installer = create_user 'bob'
      @install_commands = @installer.send :install_commands
      @install_commands.should == "adduser  --gecos ,,, bob"
    end
    
    it "should merge flags" do
      @installer = create_user 'bob', :flags => "-x"
      @install_commands = @installer.send :install_commands
      @install_commands.should == "adduser -x --gecos ,,, bob"
    end
    
    it "should use actual gecos options if passed" do
      @installer = create_user 'bob', :flags => "--gecos bob,,,"
      @install_commands = @installer.send :install_commands
      @install_commands.should == "adduser --gecos bob,,, bob"
    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sprinkle-0.7.4 spec/sprinkle/installers/user_spec.rb
sprinkle-0.7.3 spec/sprinkle/installers/user_spec.rb
sprinkle-0.7.2 spec/sprinkle/installers/user_spec.rb
sprinkle-0.7.1.1 spec/sprinkle/installers/user_spec.rb
sprinkle-0.7.1 spec/sprinkle/installers/user_spec.rb
sprinkle-0.7 spec/sprinkle/installers/user_spec.rb
sprinkle-0.6.2 spec/sprinkle/installers/user_spec.rb
sprinkle-0.6.1.1 spec/sprinkle/installers/user_spec.rb
sprinkle-0.6.1 spec/sprinkle/installers/user_spec.rb