Skip to content

Commit 0092ae7

Browse files
authored
Merge pull request #12 from rspec-parameterized/sue445/lazy_in_multibyte_chars
Requires proc_to_ast 0.2.0+
2 parents a364c96 + 4c16ff0 commit 0092ae7

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

rspec-parameterized-core.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ I was inspired by [udzura's mock](https://gist.github.com/1881139).}
3333
spec.require_paths = ["lib"]
3434

3535
spec.add_dependency "parser"
36-
spec.add_dependency "proc_to_ast"
36+
spec.add_dependency "proc_to_ast", ">= 0.2.0"
3737
spec.add_dependency "rspec", ">= 2.13", "< 4"
3838
spec.add_dependency "unparser"
3939

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)