From 4b685aad7b5edeb087968c42f815be2bec14b822 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 7 Apr 2012 23:49:28 +0200 Subject: revises the regexp used in titleize The regexp used in titleize matches saxon genitive and other contractions, only to call capitalize on the captured text and have the apostrophe upcased which yields the apostrophe itself. It is more clear that the regexp matches just what it has to match. --- activesupport/test/inflector_test_cases.rb | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'activesupport/test/inflector_test_cases.rb') diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb index 879c3c1125..f0beb82ca6 100644 --- a/activesupport/test/inflector_test_cases.rb +++ b/activesupport/test/inflector_test_cases.rb @@ -211,18 +211,21 @@ module InflectorTestCases } MixtureToTitleCase = { - 'active_record' => 'Active Record', - 'ActiveRecord' => 'Active Record', - 'action web service' => 'Action Web Service', - 'Action Web Service' => 'Action Web Service', - 'Action web service' => 'Action Web Service', - 'actionwebservice' => 'Actionwebservice', - 'Actionwebservice' => 'Actionwebservice', - "david's code" => "David's Code", - "David's code" => "David's Code", - "david's Code" => "David's Code", - "Fred’s" => "Fred’s", - "Fred`s" => "Fred`s" + 'active_record' => 'Active Record', + 'ActiveRecord' => 'Active Record', + 'action web service' => 'Action Web Service', + 'Action Web Service' => 'Action Web Service', + 'Action web service' => 'Action Web Service', + 'actionwebservice' => 'Actionwebservice', + 'Actionwebservice' => 'Actionwebservice', + "david's code" => "David's Code", + "David's code" => "David's Code", + "david's Code" => "David's Code", + "sgt. pepper's" => "Sgt. Pepper's", + "i've just seen a face" => "I've Just Seen A Face", + "maybe you'll be there" => "Maybe You'll Be There", + "Fred’s" => "Fred’s", + "Fred`s" => "Fred`s" } OrdinalNumbers = { -- cgit v1.2.3