Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #499 from gdrooid/capitalize
Browse files Browse the repository at this point in the history
Renamed Capitalize as Uppercase (issue #489)
  • Loading branch information
moollaza committed Jun 17, 2014
2 parents 154f75f + f2b4c95 commit 4053bd5
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 43 deletions.
23 changes: 0 additions & 23 deletions lib/DDG/Goodie/Capitalize.pm

This file was deleted.

2 changes: 1 addition & 1 deletion lib/DDG/Goodie/TitleCase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package DDG::Goodie::TitleCase;

use DDG::Goodie;

triggers startend => 'titlecase', 'ucfirst', 'title case';
triggers startend => 'titlecase', 'ucfirst', 'title case', 'capitalize';

primary_example_queries 'titlecase test';
description 'return the query in title case';
Expand Down
24 changes: 24 additions & 0 deletions lib/DDG/Goodie/Uppercase.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package DDG::Goodie::Uppercase;

use DDG::Goodie;

triggers startend => 'uppercase', 'upper case', 'allcaps', 'all caps';

zci is_cached => 1;
zci answer_type => "uppercase";

primary_example_queries 'uppercase this';
secondary_example_queries 'upper case that';

name 'Uppercase';
description 'Make a string uppercase.';
code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Uppercase.pm';
category 'conversions';
topics 'programming';

attribution twitter => 'crazedpsyc',
cpan => 'CRZEDPSYC' ;

handle remainder => sub { uc ($_) };

1;
19 changes: 0 additions & 19 deletions t/Capitalize.t

This file was deleted.

1 change: 1 addition & 0 deletions t/TitleCase.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ddg_goodie_test(
'titlecase this is a walk in the park' => test_zci('This Is a Walk in the Park'),
'titlecase a good day to die hard' => test_zci('A Good Day to Die Hard'),
'titlecase here i am testing-hyphenated-words' => test_zci('Here I Am Testing-Hyphenated-Words'),
'capitalize this should be capitalized' => test_zci('This Should Be Capitalized'),
'titlecase test' => test_zci('Test'),
);

Expand Down
22 changes: 22 additions & 0 deletions t/Uppercase.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env perl

use strict;
use warnings;
use Test::More;
use DDG::Test::Goodie;

zci answer_type => 'uppercase';
zci is_cached => 1;

ddg_goodie_test(
[qw(
DDG::Goodie::Uppercase
)],
'upper case this' => test_zci('THIS'),
'uppercase that' => test_zci('THAT'),
'allcaps this string' => test_zci('THIS STRING'),
'that string all caps' => test_zci('THAT STRING'),
'is this uppercase, sir?' => undef,
);

done_testing;

0 comments on commit 4053bd5

Please sign in to comment.