summaryrefslogtreecommitdiff
path: root/spec/ruby/library/yaml/shared/load.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/yaml/shared/load.rb')
-rw-r--r--spec/ruby/library/yaml/shared/load.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/ruby/library/yaml/shared/load.rb b/spec/ruby/library/yaml/shared/load.rb
index 185a5a60cd..bd55332fe5 100644
--- a/spec/ruby/library/yaml/shared/load.rb
+++ b/spec/ruby/library/yaml/shared/load.rb
@@ -1,14 +1,16 @@
-require_relative '../fixtures/common'
require_relative '../fixtures/strings'
+require 'yaml'
+
describe :yaml_load_safe, shared: true do
it "returns a document from current io stream when io provided" do
- File.open($test_file, 'w') do |io|
+ @test_file = tmp("yaml_test_file")
+ File.open(@test_file, 'w') do |io|
YAML.dump( ['badger', 'elephant', 'tiger'], io )
end
- File.open($test_file) { |yf| YAML.send(@method, yf ) }.should == ['badger', 'elephant', 'tiger']
+ File.open(@test_file) { |yf| YAML.send(@method, yf ) }.should == ['badger', 'elephant', 'tiger']
ensure
- rm_r $test_file
+ rm_r @test_file
end
it "loads strings" do
@@ -104,7 +106,7 @@ describe :yaml_load_unsafe, shared: true do
Date.new( 2001, 8, 12 ),
Date.new( 2001, 8, 14 ) ]
}
- YAML.send(@method, $complex_key_1).should == expected
+ YAML.send(@method, YAMLSpecs::COMPLEX_KEY_1).should == expected
end
describe "with iso8601 timestamp" do