-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Conversation
I like this. Thanks! |
@@ -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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. 😄
There was a problem hiding this comment.
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. ❤️
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Meh, I trust you. Sorry for the delay. |
❤️ |
ignored_status_codes.include? 429
will be false ifignored_status_codes = ["429"]