features/support/load_tests.rb in csvlint-1.3.0 vs features/support/load_tests.rb in csvlint-1.4.0
- old
+ new
@@ -14,21 +14,21 @@
file = File.join(BASE_PATH, filename)
uri = URI.join(BASE_URI, filename)
unless File.exist?(file)
if filename.include? "/"
levels = filename.split("/")[0..-2]
- for i in 0..levels.length
+ (0..levels.length).each do |i|
dir = File.join(BASE_PATH, levels[0..i].join("/"))
Dir.mkdir(dir) unless Dir.exist?(dir)
end
end
warn("storing #{file} locally")
File.open(file, "wb") do |f|
f.puts URI.open(uri, "rb").read
end
end
- [uri, file]
+ uri
end
unless File.exist? SCRIPT_FILE_PATH
File.open(SCRIPT_FILE_PATH, "w") do |file|
File.chmod(0o755, SCRIPT_FILE_PATH)
@@ -64,11 +64,11 @@
file.puts "Feature: #{manifest["label"]}"
file.puts ""
manifest["entries"].each do |entry|
- action_uri, action_file = cache_file(entry["action"])
+ action_uri = cache_file(entry["action"])
metadata = nil
provided_files = []
missing_files = []
file.puts "\t# #{entry["id"]}"
file.puts "\t# #{entry["comment"]}"
@@ -96,10 +96,10 @@
end
missing_files << "#{action_uri}-metadata.json"
missing_files << URI.join(action_uri, "csv-metadata.json").to_s
end
entry["implicit"]&.each do |implicit|
- implicit_uri, implicit_file = cache_file(implicit)
+ implicit_uri = cache_file(implicit)
provided_files << implicit_uri.to_s
unless implicit_uri == metadata
file.puts "\t\tAnd I have a file called \"csvw/#{implicit}\" at the url \"#{implicit_uri}\""
end
end