Skip to content

Commit 11cc658

Browse files
committed
Improve multibyte spec to not use the example itself
1 parent ee7e94a commit 11cc658

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

spec/rspec/rails/example/system_example_group_spec.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ module RSpec::Rails
1414
allow(example).to receive(:class).and_return(example_class_mock)
1515
expect(example.send(:method_name)).to start_with('method_name')
1616
end
17+
end
1718

18-
it "slices long method name - #{'あ'*100}" do
19-
group = RSpec::Core::ExampleGroup.describe do
19+
it "handles long method names which include unicode characters" do
20+
group =
21+
RSpec::Core::ExampleGroup.describe do
2022
include SystemExampleGroup
2123
end
22-
example = group.new
23-
group.hooks.run(:before, :example, example)
24-
expect(example.send(:method_name).bytesize).to be <= 210
25-
end
24+
25+
example = group.new
26+
allow(example.class).to receive(:name) { "really long unicode example name - #{'あ'*100}" }
27+
28+
expect(example.send(:method_name).bytesize).to be <= 210
2629
end
2730
end
2831

0 commit comments

Comments
 (0)