summaryrefslogtreecommitdiff
path: root/spec/ruby/core/env/each_key_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/env/each_key_spec.rb')
-rw-r--r--spec/ruby/core/env/each_key_spec.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/ruby/core/env/each_key_spec.rb b/spec/ruby/core/env/each_key_spec.rb
index 82721cdb96..ad2cb560a0 100644
--- a/spec/ruby/core/env/each_key_spec.rb
+++ b/spec/ruby/core/env/each_key_spec.rb
@@ -1,5 +1,5 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
+require_relative '../../spec_helper'
+require_relative '../enumerable/shared/enumeratorized'
describe "ENV.each_key" do
@@ -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