Sha256: 8a2888cdbace6a56fcf65fcb4605e9c41a93abe6a6b513a5859c5e3935dc517f

Contents?: true

Size: 696 Bytes

Versions: 9

Compression:

Stored size: 696 Bytes

Contents

require_relative '../spec_helper'

require 'wright/util/user'

include Wright

describe Util::User do
  before(:each) { Etc.setpwent }

  describe 'user_to_uid' do
    it 'should leave integer uids alone' do
      Util::User.user_to_uid(42).must_equal 42
    end

    it 'should convert user names to uids' do
      user = Etc.getpwent
      Util::User.user_to_uid(user.name).must_equal user.uid
    end
  end

  describe 'group_to_gid' do
    it 'should leave integer gids alone' do
      Util::User.group_to_gid(42).must_equal 42
    end

    it 'should convert group names to gids' do
      group = Etc.getgrent
      Util::User.group_to_gid(group.name).must_equal group.gid
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wright-0.5.0 spec/util/user_spec.rb
wright-0.4.4 spec/util/user_spec.rb
wright-0.4.3 spec/util/user_spec.rb
wright-0.4.2 spec/util/user_spec.rb
wright-0.4.1 spec/util/user_spec.rb
wright-0.4.0 spec/util/user_spec.rb
wright-0.3.2 spec/util/user_spec.rb
wright-0.3.1 spec/util/user_spec.rb
wright-0.3.0 spec/util/user_spec.rb