diff options
Diffstat (limited to 'spec/rubyspec/library/resolv/get_name_spec.rb')
-rw-r--r-- | spec/rubyspec/library/resolv/get_name_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/rubyspec/library/resolv/get_name_spec.rb b/spec/rubyspec/library/resolv/get_name_spec.rb new file mode 100644 index 0000000000..06a27e922a --- /dev/null +++ b/spec/rubyspec/library/resolv/get_name_spec.rb @@ -0,0 +1,19 @@ +require File.expand_path('../../../spec_helper', __FILE__) +require 'resolv' + +describe "Resolv#getname" do + platform_is_not :windows do + it "resolves 127.0.0.1" do + lambda { + Resolv.getname("127.0.0.1") + }.should_not raise_error(Resolv::ResolvError) + end + end + + it "raises ResolvError when there is no result" do + res = Resolv.new([]) + lambda { + res.getname("should.raise.error") + }.should raise_error(Resolv::ResolvError) + end +end |