summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-12 07:32:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-12 07:32:21 +0000
commit8ad336b5c5e4f888d860164c914147d656ffe0f2 (patch)
tree84e8779f1790c6a914dcaf7eb43d25d8f57c438d
parentd6cd22dbc55b6b3507aa0193185b45c99ff37889 (diff)
Adopt [Misc #15294]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--spec/ruby/library/erb/new_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/ruby/library/erb/new_spec.rb b/spec/ruby/library/erb/new_spec.rb
index 0497bb7..33a3952 100644
--- a/spec/ruby/library/erb/new_spec.rb
+++ b/spec/ruby/library/erb/new_spec.rb
@@ -31,11 +31,19 @@ END
it "compiles eRuby script into ruby code when trim mode is 0 or not specified" do
expected = "<ul>\n\n\n\n<li>1</li>\n\n\n\n<li>2</li>\n\n\n\n<li>3</li>\n\n\n</ul>\n"
- [0, '', nil].each do |trim_mode|
+ [0, nil].each do |trim_mode|
ERBSpecs.new_erb(@eruby_str, trim_mode: trim_mode).result.should == expected
end
end
+ ruby_version_is "2.6" do
+ it "warns invalid trim_mode" do
+ lambda do
+ ERBSpecs.new_erb(@eruby_str, trim_mode: '')
+ end.should output(nil, /Invalid ERB trim mode/)
+ end
+ end
+
it "removes '\n' when trim_mode is 1 or '>'" do
expected = "<ul>\n<li>1</li>\n<li>2</li>\n<li>3</li>\n</ul>\n"
[1, '>'].each do |trim_mode|