aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/env/shared/length.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/env/shared/length.rb')
-rw-r--r--spec/ruby/core/env/shared/length.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/core/env/shared/length.rb b/spec/ruby/core/env/shared/length.rb
new file mode 100644
index 0000000000..6d788a3f4a
--- /dev/null
+++ b/spec/ruby/core/env/shared/length.rb
@@ -0,0 +1,13 @@
+describe :env_length, shared: true do
+ it "returns the number of ENV entries" do
+ orig = ENV.to_hash
+ begin
+ ENV.clear
+ ENV["foo"] = "bar"
+ ENV["baz"] = "boo"
+ ENV.send(@method).should == 2
+ ensure
+ ENV.replace orig
+ end
+ end
+end