You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't see any unit tests for this method. Is this intentional?
defparse_file_extensionifnew_resource.extension.nil?# purge any trailing redirecturl=new_resource.url.cloneurl =~ /^https?:\/\/.*(.gz|bz2|bin|zip|jar|tgz|tbz)(\/.*\/)/url.gsub!($2,'')unless $2.nil?# remove tailing query stringrelease_basename= ::File.basename(url.gsub(/\?.*\z/,'')).gsub(/-bin\b/,'')# (\?.*)? accounts for a trailing querystringChef::Log.debug("DEBUG: release_basename is #{release_basename}")release_basename =~ %r{^(.+?)\.(tar\.gz|tar\.bz2|zip|war|jar|tgz|tbz)(\?.*)?}Chef::Log.debug("DEBUG: file_extension is #{$2}")new_resource.extension= $2
endnew_resource.extensionend
Where would I go about adding unit tests? I'd like to demonstrate that the regexes are pretty brittle. For example, this does not match: "http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.0.6.v20130930.tar.gz&r=1".
The text was updated successfully, but these errors were encountered:
I didn't see any unit tests for this method. Is this intentional?
Where would I go about adding unit tests? I'd like to demonstrate that the regexes are pretty brittle. For example, this does not match:
"http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.0.6.v20130930.tar.gz&r=1"
.The text was updated successfully, but these errors were encountered: