diff --git a/lib/pp.rb b/lib/pp.rb index 1708dee05e..7c4ba0e672 100644 --- a/lib/pp.rb +++ b/lib/pp.rb @@ -438,7 +438,7 @@ class Data # :nodoc: def pretty_print_cycle(q) # :nodoc: q.text sprintf("#", PP.mcall(self, Kernel, :class).name) end -end if "3.2" <= RUBY_VERSION +end if defined?(Data.define) class Range # :nodoc: def pretty_print(q) # :nodoc: diff --git a/test/test_pp.rb b/test/test_pp.rb index f6c2f65df2..d7cca82a00 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -143,7 +143,7 @@ class PPCycleTest < Test::Unit::TestCase assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup)) end - if "3.2" <= RUBY_VERSION + if defined?(Data.define) D = Data.define(:aaa, :bbb) def test_data a = D.new("aaa", "bbb")