From e478671e19e09bf50ceb52efa720a8c520d87704 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 26 Jun 2019 09:23:02 +0900 Subject: Added version guard for backtrace printing feature of psych to ruby/spec. --- spec/ruby/library/yaml/to_yaml_spec.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'spec/ruby/library/yaml') diff --git a/spec/ruby/library/yaml/to_yaml_spec.rb b/spec/ruby/library/yaml/to_yaml_spec.rb index 8e80b02cb4..03ec4f6916 100644 --- a/spec/ruby/library/yaml/to_yaml_spec.rb +++ b/spec/ruby/library/yaml/to_yaml_spec.rb @@ -72,8 +72,16 @@ describe "Object#to_yaml" do true_klass.to_yaml.should match_yaml("--- true\n") end - it "returns the YAML representation of a Error object" do - StandardError.new("foobar").to_yaml.should match_yaml("--- !ruby/exception:StandardError\nmessage: foobar\nbacktrace: \n") + ruby_version_is ""..."2.7" do + it "returns the YAML representation of a Error object" do + StandardError.new("foobar").to_yaml.should match_yaml("--- !ruby/exception:StandardError\nmessage: foobar\n") + end + end + + ruby_version_is "2.7" do + it "returns the YAML representation of a Error object" do + StandardError.new("foobar").to_yaml.should match_yaml("--- !ruby/exception:StandardError\nmessage: foobar\nbacktrace: \n") + end end it "returns the YAML representation for Range objects" do -- cgit v1.2.3