summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-04-09 13:24:30 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-04-09 13:24:30 -0700
commit2197a9e30126df626771d4360607dba8fa92e533 (patch)
treeb497da6aed4e1a3bcdb1e7aca06a5641c9604bb4
parent774977e39b4a31b32f7ea607b2af223507e59f59 (diff)
downloadpsych-2197a9e30126df626771d4360607dba8fa92e533.zip
adding deprecation warnings
-rw-r--r--lib/psych/deprecated.rb1
-rw-r--r--test/psych/test_psych.rb6
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/psych/deprecated.rb b/lib/psych/deprecated.rb
index ec3cfe4..5a96e91 100644
--- a/lib/psych/deprecated.rb
+++ b/lib/psych/deprecated.rb
@@ -5,6 +5,7 @@ module Psych
end
def self.quick_emit thing, opts = {}, &block # :nodoc:
+ warn "#{caller[0]}: YAML.quick_emit is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
target = eval 'self', block.binding
target.extend DeprecatedMethods
metaclass = class << target; self; end
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 22baa14..91c67b1 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -4,6 +4,12 @@ require 'stringio'
require 'tempfile'
class TestPsych < Psych::TestCase
+ def test_load_argument_error
+ assert_raises(TypeError) do
+ Psych.load nil
+ end
+ end
+
def test_dump_stream
things = [22, "foo \n", {}]
stream = Psych.dump_stream(*things)