Skip to content

Commit

Permalink
Merge pull request #1135 from judofyr/heredoc-jruby-line-number
Browse files Browse the repository at this point in the history
Add test for line number in HEREDOC with method call
  • Loading branch information
andrykonchin authored Jun 26, 2024
2 parents 78bbeaa + ea73805 commit e4d2612
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions language/heredoc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@
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

it "reports line numbers inside HEREDOC with method call" do
-> {
<<-HERE.chomp
a
b
#{c}
HERE
}.should raise_error(NameError) { |e| e.backtrace[0].should.start_with?("#{__FILE__}:#{__LINE__ - 2}") }
end
end

0 comments on commit e4d2612

Please sign in to comment.