mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix documentation for ENV.each to return ENV
Also have spec check that it returns ENV. Mostly from burdettelamar@yahoo.com (Burdette Lamar). Fixes [Bug #16164]
This commit is contained in:
parent
7aeacb213b
commit
27144de2bd
2 changed files with 3 additions and 3 deletions
4
hash.c
4
hash.c
|
@ -5276,9 +5276,9 @@ env_each_value(VALUE ehash)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* ENV.each { |name, value| block } -> Hash
|
* ENV.each { |name, value| block } -> ENV
|
||||||
* ENV.each -> Enumerator
|
* ENV.each -> Enumerator
|
||||||
* ENV.each_pair { |name, value| block } -> Hash
|
* ENV.each_pair { |name, value| block } -> ENV
|
||||||
* ENV.each_pair -> Enumerator
|
* ENV.each_pair -> Enumerator
|
||||||
*
|
*
|
||||||
* Yields each environment variable +name+ and +value+.
|
* Yields each environment variable +name+ and +value+.
|
||||||
|
|
2
spec/ruby/core/env/shared/each.rb
vendored
2
spec/ruby/core/env/shared/each.rb
vendored
|
@ -8,7 +8,7 @@ describe :env_each, shared: true do
|
||||||
ENV.clear
|
ENV.clear
|
||||||
ENV["foo"] = "bar"
|
ENV["foo"] = "bar"
|
||||||
ENV["baz"] = "boo"
|
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(["foo", "bar"])
|
||||||
e.should include(["baz", "boo"])
|
e.should include(["baz", "boo"])
|
||||||
ensure
|
ensure
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue