Fix OpenJDK scraper
Unified · Split
| @@ -29,7 +29,7 @@ module Docs · 28 unmodified lines | ||
| 29 | 29 | |
| 30 | 30 | def request_one(url) |
| 31 | 31 | assert_source_directory_exists |
| 32 | − Response.new read_file(url_to_path(url)), URL.parse(url) | |
| 32 | + Response.new read_file(File.join(source_directory, url_to_path(url))), URL.parse(url) | |
| 33 | 33 | end |
| 34 | 34 | |
| 35 | 35 | def request_all(urls) |
| @@ -50,7 +50,7 @@ module Docs · 14 unmodified lines | ||
| 50 | 50 | end |
| 51 | 51 | |
| 52 | 52 | def read_file(path) |
| 53 | − File.read(File.join(source_directory, path)) | |
| 53 | + File.read(path) | |
| 54 | 54 | rescue |
| 55 | 55 | instrument 'warn.doc', msg: "Failed to open file: #{path}" |
| 56 | 56 | nil |
| @@ -63,7 +63,7 @@ class FileScraperTest < MiniTest::Spec · 62 unmodified lines | ||
| 63 | 63 | end |
| 64 | 64 | |
| 65 | 65 | it "reads a file" do |
| 66 | − mock(scraper).read_file(path) | |
| 66 | + mock(scraper).read_file(File.join(ROOT_PATH, 'docs/scraper', path)) | |
| 67 | 67 | result |
| 68 | 68 | end |
| 69 | 69 | |
| @@ -165,7 +165,7 @@ class FileScraperTest < MiniTest::Spec · 95 unmodified lines | ||
| 165 | 165 | |
| 166 | 166 | describe "#read_file" do |
| 167 | 167 | let :result do |
| 168 | − scraper.send :read_file, 'file' | |
| 168 | + scraper.send :read_file, File.join(ROOT_PATH, 'docs', 'scraper', 'file') | |
| 169 | 169 | end |
| 170 | 170 | |
| 171 | 171 | it "returns the file's content when the file exists in the source directory" do |