Permalink
Browse files

strip trailing whitespace from description

  • Loading branch information...
1 parent 8299b71 commit 432677cbd0566f67d25fdf3c3de77ced5ddee4ed @frioux committed Oct 13, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −0 lib/DU/RecipeParser.pm
  2. +0 −2 t/integration/app/drink.t
  3. +1 −1 t/parser.t
View
2 lib/DU/RecipeParser.pm
@@ -104,6 +104,7 @@ sub encode_recipe {
$_[0]->{name}
$_[0]->{description}
+
$ingredients
$source
RECIPE
@@ -130,6 +131,7 @@ sub got_teaspoon { 'teaspoon' }
sub got_dash { 'dash' }
sub got_description {
+ $_[1] =~ s/\s$//g;
$data->{description} = $_[1];
}
View
2 t/integration/app/drink.t
@@ -96,7 +96,6 @@ subtest 'new' => sub {
'',
q(I'm not actually much of a fan.),
'',
- '',
q(Source: my brain, sector 5),
'',
'',
@@ -171,7 +170,6 @@ subtest 'edit' => sub {
"It's a mask of your own face. Could a halloween mask",
'be any better than that?',
'',
- '',
'Variants: Frewba Libre',
'',
'Source: my brain, sector 6',
View
2 t/parser.t
@@ -26,7 +26,7 @@ Source: 500 Cocktails, p27
RECIPE
my $expected = {
- description => "This is a delicious beverage for a hot day.\nRefreshing.\n\nDrink it at a wedding.\n",
+ description => "This is a delicious beverage for a hot day.\nRefreshing.\n\nDrink it at a wedding.",
ingredients => [{
amount => 4,
name => "Club Soda",

0 comments on commit 432677c

Please sign in to comment.