Skip to content
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

htmlproofer should set status codes to ints #319

Merged
merged 2 commits into from
Apr 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/htmlproofer
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Mercenary.program(:htmlproofer) do |p|

options[:cache] = {}
options[:cache][:timeframe] = opts['timeframe'] unless opts['timeframe'].nil?

options[:http_status_ignore] = Array(options[:http_status_ignore]).map(&:to_i)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be options[:http_status_ignore].split(',') to get the array for multiple codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You specify it as an Array so OptionsParser will give it to you as such. I tested it locally and it works. 😄

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for it? In irb at least I get:

Array("421, 422").map(&:to_i)
=> [421]
irb(main):005:0> 

https://github.com/gjtorikian/html-proofer/blob/4434b7eecb19d869c59c92e6480661d18866253c/spec/html-proofer/command_spec.rb is where all the bin tests go. ❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gjtorikian the input isn't "421, 422", it's ["421", "422"] I'll add a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch that. @gjtorikian I can't use both VCR and the executable because the executable doesn't share the same Ruby env as the specs.

Trust that this line does what I'm saying it does?


paths = path.split(',')
if opts['as_links']
Expand Down