fix File and Dir exists? vs. exist?

This commit is contained in:
Andy Meneely
2023-01-24 12:47:16 -05:00
parent 8d872b15b6
commit 4331625272
8 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ describe Squib::Args::SaveBatch do
expect(Squib.logger).to receive(:warn).with("Dir 'tocreate' does not exist, creating it.").once
save_batch.load! opts
expect(save_batch).to have_attributes({ dir: ['tocreate'] })
expect(Dir.exists? 'tocreate').to be true
expect(Dir.exist? 'tocreate').to be true
end
end
end
+3 -3
View File
@@ -25,18 +25,18 @@ describe Squib::Commands::New do
it 'creates a basic template on an fresh directory' do
@cmd.process(['foo'], false)
expect(File.exists?('foo/deck.rb')).to be true
expect(File.exist?('foo/deck.rb')).to be true
end
it 'creates an advanced template on an fresh directory' do
@cmd.process(['foo'], true)
expect(File.exists?('foo/src/deck.rb')).to be true
expect(File.exist?('foo/src/deck.rb')).to be true
end
it 'creates a new template on an empty directory' do
Dir.mkdir('foo')
@cmd.process(['foo'], false)
expect(File.exists?('foo/deck.rb')).to be true
expect(File.exist?('foo/deck.rb')).to be true
end
it 'does not create a new template on an empty ' do