summaryrefslogtreecommitdiff
path: root/spec/ruby/library/yaml
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-26 09:23:02 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-26 09:23:02 +0900
commite478671e19e09bf50ceb52efa720a8c520d87704 (patch)
tree721b0b371a2470f79e7c2ad40d66abd7469b05b1 /spec/ruby/library/yaml
parentcfa1a1843167e9dc8404403d3a64a506c3d6ce92 (diff)
Added version guard for backtrace printing feature of psych to ruby/spec.
Diffstat (limited to 'spec/ruby/library/yaml')
-rw-r--r--spec/ruby/library/yaml/to_yaml_spec.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/ruby/library/yaml/to_yaml_spec.rb b/spec/ruby/library/yaml/to_yaml_spec.rb
index 8e80b02..03ec4f6 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