Updated RubySpec source to 55122684.
[rbx.git] / spec / frozen / 1.8 / library / etc / getpwnam_spec.rb
blob60ab58dcc56e6d879a7c09e4a0487b708fc90db5
1 require File.dirname(__FILE__) + '/../../spec_helper'
2 require 'etc'
4 describe "Etc.getpwnam" do
5   it "returns a Passwd struct instance for the given user" do
6     pw = Etc.getpwnam(`whoami`.strip)
8     deviates_on :rubinius do
9       pw.is_a?(Etc::Passwd).should == true
10     end
12     compliant_on(:ruby, :jruby) do
13       pw.is_a?(Struct::Passwd).should == true
14     end
15   end
17   it "only accepts strings as argument" do
18     lambda {
19       Etc.getpwnam(123)
20       Etc.getpwnam(nil)
21     }.should raise_error(TypeError)
22   end
23 end