Skip to content

Commit bd09082

Browse files
committed
add testcase for multibyte char in lazy
1 parent 94ed779 commit bd09082

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

spec/rspec/parameterized/core_spec.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,50 @@
259259
end
260260
end
261261
end
262+
263+
context "have multibyte string usecase" do
264+
context 'only in lazy' do
265+
where(:value, :answer) do
266+
[
267+
["non multibyte parameter", lazy { "パラメータ is non multibyte parameter" }]
268+
]
269+
end
270+
271+
with_them do
272+
it "should run with correct description" do
273+
expect("パラメータ is #{value}").to eq answer
274+
end
275+
end
276+
end
277+
278+
context 'with multibyte other parameter' do
279+
where(:value, :answer) do
280+
[
281+
["lazyとは別のパラメータ", lazy { "パラメータ is lazyとは別のパラメータ" }]
282+
]
283+
end
284+
285+
with_them do
286+
it "should run with correct description" do
287+
expect("パラメータ is #{value}").to eq answer
288+
end
289+
end
290+
end
291+
292+
context 'use マルチバイト in ancestor context description' do
293+
where(:value, :answer) do
294+
[
295+
["non multibyte parameter", lazy { "パラメータ is non multibyte parameter"}]
296+
]
297+
end
298+
299+
with_them do
300+
it "should run with correct description" do
301+
expect("パラメータ is #{value}").to eq answer
302+
end
303+
end
304+
end
305+
end
262306
end
263307

264308
context "when the where block is after with_them" do

0 commit comments

Comments
 (0)