Permalink
Browse files

merging from ruby

  • Loading branch information...
1 parent 24c31c2 commit 7f812e945b73e3c696b1baeebbc1516e94f8d16a @tenderlove tenderlove committed Nov 7, 2011
Showing with 12 additions and 10 deletions.
  1. +6 −4 test/psych/test_yamldbm.rb
  2. +6 −6 test/psych/test_yamlstore.rb
View
@@ -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 @@ def test_selsct_with_block
assert_equal([], @yamldbm.select {false})
end
end
-end if defined?(YAML::DBM)
+end if defined?(YAML::DBM) && defined?(Psych)
@@ -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 @@ def test_changes_are_not_written_on_abort
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)

0 comments on commit 7f812e9

Please sign in to comment.