Sha256: 0f165a273744fd3194c5a498b921200d0de79b2ec046ba93dcb3a85dedb03568

Contents?: true

Size: 1.44 KB

Versions: 37

Compression:

Stored size: 1.44 KB

Contents

require 'spec_helper'

set :os, { :family => 'darwin' }

describe get_command(:check_user_has_home_directory, 'foo', '/Users/foo') do
  it { should eq "finger foo | grep -E '^Directory' | awk '{ print $2 }' | grep -E '^/Users/foo$'" }
end

describe get_command(:check_user_has_login_shell, 'foo', '/bin/bash') do
  it { should eq "finger foo | grep -E '^Directory' | awk '{ print $4 }' | grep -E '^/bin/bash$'" }
end

describe get_command(:get_user_home_directory, 'foo') do
  it { should eq "finger foo | grep -E '^Directory' | awk '{ print $2 }'" }
end

describe get_command(:update_user_home_directory, 'user', 'dir') do
  it { should eq "dscl . -create /Users/user NFSHomeDirectory dir" }
end

describe get_command(:update_user_login_shell, 'user', '/bin/bash') do
  it { should eq "dscl . -create /Users/user UserShell /bin/bash" }
end

describe get_command(:update_user_encrypted_password, 'user', 'pass') do
  it { should eq "dscl . passwd /Users/user pass" }
end

describe get_command(:update_user_gid, 'user', '100') do
  it { should eq "dscl . -create /Users/user PrimaryGroupID 100" }
end

describe get_command(:add_user, 'foo', :home_directory => '/Users/foo', :password => '$6$foo/bar', :shell => '/bin/zsh', :create_home => true) do
  it { should eq 'dscl . -create /Users/foo && dscl . -create /Users/foo UserShell /bin/zsh && dscl . -create /Users/foo NFSHomeDirectory /Users/foo && dscl . passwd /Users/foo \$6\$foo/bar && createhomedir -b -u foo' }
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
specinfra-2.91.0 spec/command/darwin/user_spec.rb
specinfra-2.90.1 spec/command/darwin/user_spec.rb
specinfra-2.90.0 spec/command/darwin/user_spec.rb
specinfra-2.89.0 spec/command/darwin/user_spec.rb
specinfra-2.88.2 spec/command/darwin/user_spec.rb
specinfra-2.88.1 spec/command/darwin/user_spec.rb
specinfra-2.88.0 spec/command/darwin/user_spec.rb
specinfra-2.87.2 spec/command/darwin/user_spec.rb
specinfra-2.87.1 spec/command/darwin/user_spec.rb
specinfra-2.87.0 spec/command/darwin/user_spec.rb
specinfra-2.86.0 spec/command/darwin/user_spec.rb
specinfra-2.85.1 spec/command/darwin/user_spec.rb
specinfra-2.85.0 spec/command/darwin/user_spec.rb
specinfra-2.84.1 spec/command/darwin/user_spec.rb
specinfra-2.84.0 spec/command/darwin/user_spec.rb
specinfra-2.83.4 spec/command/darwin/user_spec.rb
specinfra-2.83.3 spec/command/darwin/user_spec.rb
specinfra-2.83.2 spec/command/darwin/user_spec.rb
specinfra-2.83.1 spec/command/darwin/user_spec.rb
specinfra-2.83.0 spec/command/darwin/user_spec.rb