New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post_url tag raises ArgumentError for invalid name #1825

Merged
merged 3 commits into from Dec 26, 2013

Conversation

Projects
None yet
4 participants
@arika
Contributor

arika commented Dec 14, 2013

Using post_url tag with invalid name raises TypeError.

It should raise ArgumentError and should display detail of the error to
fix the error.

post_url tag raises ArgumentError for invalid name
Using post_url tag with invalid name raises TypeError.

It should raise ArgumentError and should display detail of the error to
fix the error.
@coveralls

This comment has been minimized.

coveralls commented Dec 14, 2013

Coverage Status

Coverage increased (+0.04%) when pulling a5545d5 on arika:smallfix_post_url_tag_behavior_for_invalid_names into b7bdcb1 on jekyll:master.

@@ -7,6 +7,7 @@ class PostComparer
def initialize(name)
all, path, date, slug = *name.sub(/^\//, "").match(MATCHER)
raise ArgumentError unless all

This comment has been minimized.

@parkr

parkr Dec 14, 2013

Member

Can you make this error more descriptive?

@coveralls

This comment has been minimized.

coveralls commented Dec 15, 2013

Coverage Status

Coverage increased (+0.2%) when pulling 9d259fe on arika:smallfix_post_url_tag_behavior_for_invalid_names into b7bdcb1 on jekyll:master.

@@ -7,6 +7,7 @@ class PostComparer
def initialize(name)
all, path, date, slug = *name.sub(/^\//, "").match(MATCHER)
raise ArgumentError.new("invalid post name") unless all

This comment has been minimized.

@parkr

parkr Dec 15, 2013

Member

Can you give the offending post name in here too? Want to be as helpful as possible.

This comment has been minimized.

@arika

arika Dec 16, 2013

Contributor

How about "'#{name}' does not contain valid date and/or title" ?

This comment has been minimized.

@parkr

parkr Dec 16, 2013

Member

👍

title: Invalid post name linking
---
{% post_url abc2008-11-21-complex %}

This comment has been minimized.

@parkr

parkr Dec 15, 2013

Member

Does this still allow for linking to just plain ol' 2008-11-21-complex?

This comment has been minimized.

@arika

arika Dec 16, 2013

Contributor

Yes. ArgumentError is raised only when name is not match against MATCHER. (Another tests are passed.)

@coveralls

This comment has been minimized.

coveralls commented Dec 17, 2013

Coverage Status

Coverage increased (+0.04%) when pulling ecab2eb on arika:smallfix_post_url_tag_behavior_for_invalid_names into b7bdcb1 on jekyll:master.

@parkr

This comment has been minimized.

Member

parkr commented Dec 17, 2013

LGTM! Thanks for this, @arika.

@mattr-?

parkr added a commit that referenced this pull request Dec 26, 2013

@parkr parkr merged commit 791c6d8 into jekyll:master Dec 26, 2013

1 check passed

default The Travis CI build passed
Details

parkr added a commit that referenced this pull request Dec 26, 2013

@ghost ghost assigned parkr Dec 26, 2013

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.