summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-11-07 08:27:43 -0300
committerAaron Patterson <aaron.patterson@gmail.com>2011-11-07 08:27:43 -0300
commit7f812e945b73e3c696b1baeebbc1516e94f8d16a (patch)
treeb333bb2bc5c6a1249930fbb9d35e04657c3b18a1 /test
parent24c31c2567ff9073e1207ad90e474cfce9356991 (diff)
downloadpsych-7f812e945b73e3c696b1baeebbc1516e94f8d16a.zip
merging from ruby
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_yamldbm.rb10
-rw-r--r--test/psych/test_yamlstore.rb12
2 files changed, 12 insertions, 10 deletions
diff --git a/test/psych/test_yamldbm.rb b/test/psych/test_yamldbm.rb
index 5fd2d77..bff1363 100644
--- a/test/psych/test_yamldbm.rb
+++ b/test/psych/test_yamldbm.rb
@@ -1,15 +1,17 @@
# -*- coding: UTF-8 -*-
+
+require 'psych/helper'
+require 'tmpdir'
+
begin
- require 'test/unit'
require 'yaml/dbm'
- require 'tmpdir'
rescue LoadError
end
module Psych
::Psych::DBM = ::YAML::DBM unless defined?(::Psych::DBM)
- class YAMLDBMTest < Test::Unit::TestCase
+ class YAMLDBMTest < TestCase
def setup
@engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'psych'
@dir = Dir.mktmpdir("rubytest-file")
@@ -191,4 +193,4 @@ module Psych
assert_equal([], @yamldbm.select {false})
end
end
-end if defined?(YAML::DBM)
+end if defined?(YAML::DBM) && defined?(Psych)
diff --git a/test/psych/test_yamlstore.rb b/test/psych/test_yamlstore.rb
index d607013..5d6fcb7 100644
--- a/test/psych/test_yamlstore.rb
+++ b/test/psych/test_yamlstore.rb
@@ -1,11 +1,11 @@
-require 'test/unit'
+require 'psych/helper'
require 'yaml/store'
require 'tmpdir'
-Psych::Store = YAML::Store unless defined?(Psych::Store)
-
module Psych
- class YAMLStoreTest < Test::Unit::TestCase
+ Psych::Store = YAML::Store unless defined?(Psych::Store)
+
+ class YAMLStoreTest < TestCase
def setup
@engine, YAML::ENGINE.yamler = YAML::ENGINE.yamler, 'psych'
@dir = Dir.mktmpdir("rubytest-file")
@@ -77,11 +77,11 @@ module Psych
end
def test_writing_inside_readonly_transaction_raises_error
- assert_raise(PStore::Error) do
+ assert_raises(PStore::Error) do
@yamlstore.transaction(true) do
@yamlstore[:foo] = "bar"
end
end
end
end
-end
+end if defined?(Psych)