Skip to content

Commit

Permalink
merging from ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Nov 7, 2011
1 parent 24c31c2 commit 7f812e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions test/psych/test_yamldbm.rb
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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)
12 changes: 6 additions & 6 deletions test/psych/test_yamlstore.rb
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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.