diff options
Diffstat (limited to 'spec/ruby/core/env/each_key_spec.rb')
| -rw-r--r-- | spec/ruby/core/env/each_key_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/ruby/core/env/each_key_spec.rb b/spec/ruby/core/env/each_key_spec.rb index 294bf39912..ad2cb560a0 100644 --- a/spec/ruby/core/env/each_key_spec.rb +++ b/spec/ruby/core/env/each_key_spec.rb @@ -10,16 +10,18 @@ describe "ENV.each_key" do ENV.clear ENV["1"] = "3" ENV["2"] = "4" - ENV.each_key { |k| e << k } - e.should include("1") - e.should include("2") + ENV.each_key { |k| e << k }.should.equal?(ENV) + e.should.include?("1") + e.should.include?("2") ensure ENV.replace orig end end it "returns an Enumerator if called without a block" do - ENV.each_key.should be_an_instance_of(Enumerator) + enum = ENV.each_key + enum.should.instance_of?(Enumerator) + enum.to_a.should == ENV.keys end it "returns keys in the locale encoding" do |
