summaryrefslogtreecommitdiff
path: root/spec/ruby/core/env/fetch_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/env/fetch_spec.rb')
-rw-r--r--spec/ruby/core/env/fetch_spec.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/ruby/core/env/fetch_spec.rb b/spec/ruby/core/env/fetch_spec.rb
index ef8f0a4ed3..a2ec79c62b 100644
--- a/spec/ruby/core/env/fetch_spec.rb
+++ b/spec/ruby/core/env/fetch_spec.rb
@@ -1,5 +1,6 @@
require_relative '../../spec_helper'
require_relative '../../shared/hash/key_error'
+require_relative 'fixtures/common'
describe "ENV.fetch" do
before :each do
@@ -15,7 +16,7 @@ describe "ENV.fetch" do
end
it "raises a TypeError if the key is not a String" do
- -> { ENV.fetch Object.new }.should raise_error(TypeError, "no implicit conversion of Object into String")
+ -> { ENV.fetch Object.new }.should.raise(TypeError, "no implicit conversion of Object into String")
end
context "when the key is not found" do
@@ -24,7 +25,7 @@ describe "ENV.fetch" do
it "formats the object with #inspect in the KeyError message" do
-> {
ENV.fetch('foo')
- }.should raise_error(KeyError, 'key not found: "foo"')
+ }.should.raise(KeyError, 'key not found: "foo"')
end
end
@@ -46,7 +47,7 @@ describe "ENV.fetch" do
it "warns on block and default parameter given" do
-> do
- ENV.fetch("foo", "default") { "bar" }.should == "bar"
+ ENV.fetch("foo", "default") { "bar" }.should == "bar"
end.should complain(/block supersedes default value argument/)
end
@@ -57,6 +58,6 @@ describe "ENV.fetch" do
it "uses the locale encoding" do
ENV["foo"] = "bar"
- ENV.fetch("foo").encoding.should == Encoding.find('locale')
+ ENV.fetch("foo").encoding.should == ENVSpecs.encoding
end
end