Skip to content

Commit

Permalink
Avoid deprecated/removed Dir.exists? method (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
owst authored Jan 22, 2024
1 parent 00aaec0 commit 0fe8052
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion lib/slither.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def self.write(filename, definition_name, data)
end

def self.parse(filename, definition_name)
raise ArgumentError, "File #{filename} does not exist." unless File.exists?(filename)
raise ArgumentError, "File #{filename} does not exist." unless File.exist?(filename)

file_io = File.open(filename, 'r')
parseIo(file_io, definition_name)
Expand Down
4 changes: 0 additions & 4 deletions spec/slither_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@
end

context "when the file is found" do
before do
allow(File).to receive(:exists?).and_return(true)
end

context "and the definition is not found" do
it "raises an error due to the definition name not being found" do
expect do
Expand Down

0 comments on commit 0fe8052

Please sign in to comment.