fix File and Dir exists? vs. exist?
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user