Skip to content

Commit

Permalink
Fix documentation for ENV.each to return ENV
Browse files Browse the repository at this point in the history
Also have spec check that it returns ENV.

Mostly from burdettelamar@yahoo.com (Burdette Lamar).

Fixes [Bug #16164]
  • Loading branch information
jeremyevans committed Sep 20, 2019
1 parent 7aeacb2 commit 27144de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hash.c
Expand Up @@ -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+.
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/env/shared/each.rb
Expand Up @@ -8,7 +8,7 @@
ENV.clear
ENV["foo"] = "bar"
ENV["baz"] = "boo"
ENV.send(@method) { |k, v| e << [k, v] }
ENV.send(@method) { |k, v| e << [k, v] }.should equal(ENV)
e.should include(["foo", "bar"])
e.should include(["baz", "boo"])
ensure
Expand Down

0 comments on commit 27144de

Please sign in to comment.