Skip to content

Commit

Permalink
Suppress deprecation warning from test code
Browse files Browse the repository at this point in the history
```
warning: File.exists? is deprecated; use File.exist? instead
```
  • Loading branch information
tricknotes committed Feb 25, 2022
1 parent 7900c52 commit 16b9c97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/extensionator/manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Manifest
def initialize(dir)
manifest_file = "#{dir}/manifest.json"

raise "Can't find manifest file" unless File.exists? manifest_file
raise "Can't find manifest file" unless File.exist? manifest_file

begin
@manifest = JSON.parse(File.read(manifest_file))
Expand Down
6 changes: 3 additions & 3 deletions test/extensionator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def teardown

def test_create
Extensionator.create(:crx, "basic", "output.crx", identity: "dummy.pem")
assert File.exists?("output.crx")
assert File.exist?("output.crx")
end

def test_crx
Extensionator.crx("basic", "output.crx", identity: "dummy.pem")
assert File.exists?("output.crx")
assert File.exist?("output.crx")
end

def test_zip
Expand Down Expand Up @@ -73,7 +73,7 @@ def except_file(file)
end

def assert_files_zip(file_set, zip_file)
assert(File.exists?(zip_file), "Zip file #{zip_file} exists")
assert(File.exist?(zip_file), "Zip file #{zip_file} exists")
zip_files = Set.new
Zip::File.open(zip_file) do |zip|
zip.each do |entry|
Expand Down

0 comments on commit 16b9c97

Please sign in to comment.