Sha256: 1c1b3cd049e890f0964f429e193095bf2e8e85eabcd72827eb0ed648d5e5c686
Contents?: true
Size: 839 Bytes
Versions: 3
Compression:
Stored size: 839 Bytes
Contents
require "massive_sitemap/writer/locking_file" describe MassiveSitemap::Writer::LockingFile do let(:filename) { 'sitemap.xml' } let(:tmp_filename) { "#{filename}.tmp" } let(:lock_file) { MassiveSitemap::Writer::LockingFile::LOCK_FILE } let(:writer) { MassiveSitemap::Writer::LockingFile.new.tap { |w| w.init! } } after do FileUtils.rm(filename) rescue nil FileUtils.rm(tmp_filename) rescue nil FileUtils.rm(lock_file) rescue nil end it 'creates lockfile' do expect do writer end.to change { File.exists?(lock_file) }.to(true) end it 'deletes lockfile' do writer expect do writer.close! end.to change { File.exists?(lock_file) }.to(false) end it 'fails if lockfile exists' do File.open(lock_file, 'w') {} expect do writer end.to raise_error end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
massive_sitemap-2.0.0.rc3 | spec/writer/locking_file_spec.rb |
massive_sitemap-2.0.0.rc2 | spec/writer/locking_file_spec.rb |
massive_sitemap-2.0.0.rc1 | spec/writer/locking_file_spec.rb |