summaryrefslogtreecommitdiff
path: root/spec/ruby/library/etc/confstr_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/etc/confstr_spec.rb')
-rw-r--r--spec/ruby/library/etc/confstr_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/ruby/library/etc/confstr_spec.rb b/spec/ruby/library/etc/confstr_spec.rb
new file mode 100644
index 0000000000..786cb16407
--- /dev/null
+++ b/spec/ruby/library/etc/confstr_spec.rb
@@ -0,0 +1,14 @@
+require_relative '../../spec_helper'
+require 'etc'
+
+platform_is_not :windows, :android do
+ describe "Etc.confstr" do
+ it "returns a String for Etc::CS_PATH" do
+ Etc.confstr(Etc::CS_PATH).should.instance_of?(String)
+ end
+
+ it "raises Errno::EINVAL for unknown configuration variables" do
+ -> { Etc.confstr(-1) }.should.raise(Errno::EINVAL)
+ end
+ end
+end