Skip to content

Commit ed602b9

Browse files
committed
Use a proper feature check to check if Data is defined
1 parent 6e086e6 commit ed602b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/pp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def pretty_print(q) # :nodoc:
438438
def pretty_print_cycle(q) # :nodoc:
439439
q.text sprintf("#<data %s:...>", PP.mcall(self, Kernel, :class).name)
440440
end
441-
end if "3.2" <= RUBY_VERSION
441+
end if defined?(Data.define)
442442

443443
class Range # :nodoc:
444444
def pretty_print(q) # :nodoc:

test/test_pp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_struct
143143
assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup))
144144
end
145145

146-
if "3.2" <= RUBY_VERSION
146+
if defined?(Data.define)
147147
D = Data.define(:aaa, :bbb)
148148
def test_data
149149
a = D.new("aaa", "bbb")

0 commit comments

Comments
 (0)