diff --git a/test/psych/test_yamlstore.rb b/test/psych/test_yamlstore.rb index 1a1be370..c2721c41 100644 --- a/test/psych/test_yamlstore.rb +++ b/test/psych/test_yamlstore.rb @@ -23,14 +23,18 @@ def load(content) class YAMLStoreTest < TestCase def setup - @dir = Dir.mktmpdir("rubytest-file") - File.chown(-1, Process.gid, @dir) - @yamlstore_file = make_tmp_filename("yamlstore") - @yamlstore = YAML::Store.new(@yamlstore_file) + if defined?(::PStore) + @dir = Dir.mktmpdir("rubytest-file") + File.chown(-1, Process.gid, @dir) + @yamlstore_file = make_tmp_filename("yamlstore") + @yamlstore = YAML::Store.new(@yamlstore_file) + else + omit "PStore is not available" + end end def teardown - FileUtils.remove_entry_secure @dir + FileUtils.remove_entry_secure(@dir) if @dir end def make_tmp_filename(prefix) @@ -97,5 +101,5 @@ def test_writing_inside_readonly_transaction_raises_error end end end - end + end if defined?(::PStore) end if defined?(Psych)