diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-12 07:32:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-12 07:32:21 +0000 |
commit | 8ad336b5c5e4f888d860164c914147d656ffe0f2 (patch) | |
tree | 84e8779f1790c6a914dcaf7eb43d25d8f57c438d /spec/ruby | |
parent | d6cd22dbc55b6b3507aa0193185b45c99ff37889 (diff) | |
download | ruby-8ad336b5c5e4f888d860164c914147d656ffe0f2.tar.gz |
Adopt [Misc #15294]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/library/erb/new_spec.rb | 10 |
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 0497bb7e15..33a3952dd4 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| |