Skip to content

Commit

Permalink
Strict paper file name
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed Nov 25, 2023
1 parent 031c40d commit 3fd7cef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/lib/paper_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def self.find(search_path)

if Dir.exist? search_path
Find.find(search_path).each do |path|
if path =~ /paper\.tex$|paper\.md$/
if path =~ /\/paper\.tex$|\/paper\.md$/
paper_path = path
break
end
Expand Down
2 changes: 1 addition & 1 deletion spec/paper_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

it "should return a nil PaperFile if no paper file found" do
expect(Dir).to receive(:exist?).with("/repo/path/").and_return(true)
allow(Find).to receive(:find).with("/repo/path/").and_return(["lib/papers.pdf", "./docs", "app"])
allow(Find).to receive(:find).with("/repo/path/").and_return(["lib/papers.pdf", "lib/other_paper.md", "./docs", "app"])

paper_file = PaperFile.find("/repo/path/")

Expand Down

0 comments on commit 3fd7cef

Please sign in to comment.