Sha256: de10b36a9a75233f10ef0256b36d6a6ac4ed4b97b6c7fc17ead1344db7719787

Contents?: true

Size: 829 Bytes

Versions: 1

Compression:

Stored size: 829 Bytes

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 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

1 entries across 1 versions & 1 rubygems

Version Path
sprinkle-0.6.0 spec/sprinkle/installers/user_spec.rb