diff options
Diffstat (limited to 'spec/ruby/language')
-rw-r--r-- | spec/ruby/language/fixtures/squiggly_heredoc.rb | 24 | ||||
-rw-r--r-- | spec/ruby/language/heredoc_spec.rb | 7 |
2 files changed, 31 insertions, 0 deletions
diff --git a/spec/ruby/language/fixtures/squiggly_heredoc.rb b/spec/ruby/language/fixtures/squiggly_heredoc.rb index afc87514c7..d223966b93 100644 --- a/spec/ruby/language/fixtures/squiggly_heredoc.rb +++ b/spec/ruby/language/fixtures/squiggly_heredoc.rb @@ -29,6 +29,14 @@ module SquigglyHeredocSpecs HERE end + def self.least_indented_on_the_first_line + <<~HERE + a + b + c + HERE + end + def self.least_indented_on_the_last_line <<~HERE a @@ -36,4 +44,20 @@ module SquigglyHeredocSpecs c HERE end + + def self.least_indented_on_the_first_line_single + <<~'HERE' + a + b + c + HERE + end + + def self.least_indented_on_the_last_line_single + <<~'HERE' + a + b + c + HERE + end end diff --git a/spec/ruby/language/heredoc_spec.rb b/spec/ruby/language/heredoc_spec.rb index e7655a9216..1ec21a2ec0 100644 --- a/spec/ruby/language/heredoc_spec.rb +++ b/spec/ruby/language/heredoc_spec.rb @@ -86,6 +86,13 @@ HERE it "selects the least-indented line and removes its indentation from all the lines" do require_relative 'fixtures/squiggly_heredoc' + SquigglyHeredocSpecs.least_indented_on_the_first_line.should == "a\n b\n c\n" SquigglyHeredocSpecs.least_indented_on_the_last_line.should == " a\n b\nc\n" end + + it "selects the least-indented line and removes its indentation from all the lines for <<~'identifier'" do + require_relative 'fixtures/squiggly_heredoc' + SquigglyHeredocSpecs.least_indented_on_the_first_line_single.should == "a\n b\n c\n" + SquigglyHeredocSpecs.least_indented_on_the_last_line_single.should == " a\n b\nc\n" + end end |