ruby-changes:53467
From: nobu <ko1@a...>
Date: Mon, 12 Nov 2018 16:32:26 +0900 (JST)
Subject: [ruby-changes:53467] nobu:r65683 (trunk): Adopt [Misc #15294]
nobu 2018-11-12 16:32:21 +0900 (Mon, 12 Nov 2018) New Revision: 65683 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65683 Log: Adopt [Misc #15294] Modified files: trunk/spec/ruby/library/erb/new_spec.rb Index: spec/ruby/library/erb/new_spec.rb =================================================================== --- spec/ruby/library/erb/new_spec.rb (revision 65682) +++ spec/ruby/library/erb/new_spec.rb (revision 65683) @@ -31,11 +31,19 @@ END https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/erb/new_spec.rb#L31 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| -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/