summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--lib/rubygems/test_case.rb5
-rw-r--r--test/rubygems/test_gem_specification.rb7
3 files changed, 9 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index b05abadebb..667445c6ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Aug 22 11:20:47 2012 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * lib/rubygems/test_case.rb: run test with psych if exist.
+
Thu Aug 16 12:09:51 2012 Yuki Yugui Sonoda <yugui@google.com>
* nacl/pepper_main.c (init_loadpath): Pushes the correct load path on
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 9fbdfca52e..38e09ccd02 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -207,6 +207,9 @@ class Gem::TestCase < MiniTest::Unit::TestCase
Gem.pre_uninstall do |uninstaller|
@pre_uninstall_hook_arg = uninstaller
end
+
+ @orig_yamler = YAML::ENGINE.yamler
+ YAML::ENGINE.yamler = 'psych' rescue nil
end
##
@@ -238,6 +241,8 @@ class Gem::TestCase < MiniTest::Unit::TestCase
else
ENV.delete 'HOME'
end
+
+ YAML::ENGINE.yamler = @orig_yamler
end
##
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index f346240692..c0dfd4bafe 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -39,8 +39,6 @@ end
def setup
super
- @orig_yamler = YAML::ENGINE.yamler
- YAML::ENGINE.yamler = 'psych'
@a1 = quick_spec 'a', '1' do |s|
s.executable = 'exec'
@@ -67,11 +65,6 @@ end
load 'rubygems/syck_hack.rb'
end
- def teardown
- super
- YAML::ENGINE.yamler = @orig_yamler
- end
-
def test_self_attribute_names
expected_value = %w[
authors