summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-13 00:27:44 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-13 00:27:44 +0000
commit5339bbe2dc3130f7e7534b0d72dd1f1d42b7f8d5 (patch)
tree5c7cccc5e6d4f1bbeeab57d0e23c90a688a9211d
parent0acaab201a821bc6591598775ffc6b6c4980ba9d (diff)
* ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
[ruby-core:38913] * test/psych/test_yaml.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/psych/lib/psych/core_ext.rb1
-rw-r--r--test/psych/test_yaml.rb7
3 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d8f31d1ec8b..2a3ce97ab3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Aug 13 09:26:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
+ [ruby-core:38913]
+ * test/psych/test_yaml.rb: corresponding test.
+
Sat Aug 13 09:05:16 2011 Tadayoshi Funaba <tadf@dotrb.org>
* ext/date/date_core.c (date_strftime_alloc): followed the change
diff --git a/ext/psych/lib/psych/core_ext.rb b/ext/psych/lib/psych/core_ext.rb
index be26b2f449c..2ad75e16610 100644
--- a/ext/psych/lib/psych/core_ext.rb
+++ b/ext/psych/lib/psych/core_ext.rb
@@ -36,4 +36,5 @@ module Kernel
end
remove_method :y rescue nil
alias y psych_y
+ private :y
end
diff --git a/test/psych/test_yaml.rb b/test/psych/test_yaml.rb
index 41bb377143a..807c058d2e4 100644
--- a/test/psych/test_yaml.rb
+++ b/test/psych/test_yaml.rb
@@ -3,6 +3,7 @@
# $Id$
#
require 'psych/helper'
+require 'ostruct'
# [ruby-core:01946]
module Psych_Tests
@@ -14,6 +15,12 @@ class Psych_Unit_Tests < Psych::TestCase
Psych.domain_types.clear
end
+ def test_y_method
+ assert_raises(NoMethodError) do
+ OpenStruct.new.y 1
+ end
+ end
+
def test_syck_compat
time = Time.utc(2010, 10, 10)
yaml = Psych.dump time