Skip to content

Commit 02734e0

Browse files
committed
Fix when multiple line
1 parent 09336d1 commit 02734e0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/rspec/parameterized/core/composite_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def self.parse_with_prism(filename, linenum)
5454
next if index < linenum - 1
5555
buf << line
5656

57-
ret = Prism.parse(buf.join("\n"))
57+
ret = Prism.parse(buf.join)
5858
return ret if ret.success?
5959
end
6060

spec/rspec/parameterized/core/composite_parser_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828
it { should eq "->(a) { a + \"ほげほげ\" }" }
2929
its(:encoding) { should eq Encoding::UTF_8 }
3030
end
31+
32+
context "multiple lines" do
33+
let(:arg) do
34+
->(a) {
35+
a +
36+
1
37+
}
38+
end
39+
40+
it { should eq "->(a) {\n a +\n 1\n }" }
41+
its(:encoding) { should eq Encoding::UTF_8 }
42+
end
3143
end
3244
end
3345
end

0 commit comments

Comments
 (0)