⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (1.17 KB)
Bug #16164
ยป diff.txt
burdettelamar@yahoo.com (Burdette Lamar), 09/20/2019 06:50 PM
diff --git a/hash.c b/hash.c
index e9d994bf70..8b84a14484 100644
--- a/hash.c
+++ b/hash.c
@@ -5276,9 +5276,9 @@ env_each_value(VALUE ehash)
/*
* call-seq:
- * ENV.each { |name, value| block } -> Hash
+ * ENV.each { |name, value| block } -> ENV
* ENV.each -> Enumerator
- * ENV.each_pair { |name, value| block } -> Hash
+ * ENV.each_pair { |name, value| block } -> ENV
* ENV.each_pair -> Enumerator
*
* Yields each environment variable +name+ and +value+.
diff --git a/spec/ruby/core/env/shared/each.rb b/spec/ruby/core/env/shared/each.rb
index 8a262e4862..b72f01b3b6 100644
--- a/spec/ruby/core/env/shared/each.rb
+++ b/spec/ruby/core/env/shared/each.rb
@@ -2,13 +2,14 @@
describe :env_each, shared: true do
it "returns each pair" do
+ env_object_id = ENV.object_id
orig = ENV.to_hash
e = []
begin
ENV.clear
ENV["foo"] = "bar"
ENV["baz"] = "boo"
- ENV.send(@method) { |k, v| e << [k, v] }
+ ENV.send(@method) { |k, v| e << [k, v] }.object_id.should == env_object_id
e.should include(["foo", "bar"])
e.should include(["baz", "boo"])
ensure
(1-1/1)
Loading...