Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc3c7232

Browse files
committed
Add perf test for singular form
1 parent206499a commitc3c7232

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎spec/perf/inflect_spec.rb‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@
1414
}.at_most(1.6).times
1515
end
1616

17-
it"allocates"do
17+
it"singularizes nouns as fast as ActiveSupport"do
18+
expect{
19+
Strings::Inflection.singularize("errors")
20+
}.toperform_slower_than{
21+
ActiveSupport::Inflector.singularize("errors")
22+
}.at_most(1.8).times
23+
end
24+
25+
it"allocates no more than 40 objects"do
1826
expect{
1927
Strings::Inflection.pluralize("error")
2028
}.toperform_allocation(40)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp