summaryrefslogtreecommitdiff
path: root/spec/ruby/core/env/element_reference_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/env/element_reference_spec.rb')
-rw-r--r--spec/ruby/core/env/element_reference_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/ruby/core/env/element_reference_spec.rb b/spec/ruby/core/env/element_reference_spec.rb
index 7d2a2d78e3..e3ac979418 100644
--- a/spec/ruby/core/env/element_reference_spec.rb
+++ b/spec/ruby/core/env/element_reference_spec.rb
@@ -1,5 +1,6 @@
-# -*- encoding: binary -*-
+# encoding: binary
require_relative '../../spec_helper'
+require_relative 'fixtures/common'
describe "ENV.[]" do
before :each do
@@ -16,7 +17,7 @@ describe "ENV.[]" do
it "returns only frozen values" do
ENV[@variable] = "a non-frozen string"
- ENV[@variable].frozen?.should == true
+ ENV[@variable].should.frozen?
end
it "coerces a non-string name with #to_str" do
@@ -27,7 +28,7 @@ describe "ENV.[]" do
end
it "raises TypeError if the argument is not a String and does not respond to #to_str" do
- -> { ENV[Object.new] }.should raise_error(TypeError, "no implicit conversion of Object into String")
+ -> { ENV[Object.new] }.should.raise(TypeError, "no implicit conversion of Object into String")
end
platform_is :windows do
@@ -58,7 +59,7 @@ describe "ENV.[]" do
it "uses the locale encoding if Encoding.default_internal is nil" do
Encoding.default_internal = nil
- locale = Encoding.find('locale')
+ locale = ENVSpecs.encoding
locale = Encoding::BINARY if locale == Encoding::US_ASCII
ENV[@variable] = "\xC3\xB8"
ENV[@variable].encoding.should == locale
@@ -70,6 +71,6 @@ describe "ENV.[]" do
ENV[@variable] = ""
Encoding.default_internal = Encoding::IBM437
- ENV[@variable].encoding.should equal(Encoding::IBM437)
+ ENV[@variable].encoding.should.equal?(Encoding::IBM437)
end
end