Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
Merge 6c69b96 into 7a4204c
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jan 7, 2019
2 parents 7a4204c + 6c69b96 commit 418eb4d
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions spec/services/digital_stacks_service_spec.rb
Expand Up @@ -244,7 +244,7 @@ def get_shelve_list(content_diff)
end
end

describe 'deprecated Dor::DigitalStacksService' do
describe '.prune_stacks_dir' do
let(:stacks_root) { Dir.mktmpdir }

before do
Expand All @@ -256,15 +256,13 @@ def get_shelve_list(content_diff)
Dor::Config.pop!
end

describe '.prune_stacks_dir' do
it 'prunes the stacks directory' do
dr = DruidTools::StacksDruid.new 'druid:aa123bb4567', stacks_root
item_root = dr.path(nil, true)
File.open(File.join(item_root, 'somefile'), 'w') { |f| f.write 'junk' }
Dor::DigitalStacksService.prune_stacks_dir 'druid:aa123bb4567'
item_pathname = Pathname item_root
expect(File).to_not exist(item_pathname)
expect(File).to_not exist(item_pathname.parent)
end
it 'prunes the stacks directory' do
dr = DruidTools::StacksDruid.new 'druid:aa123bb4567', stacks_root
item_root = dr.path(nil, true)
File.open(File.join(item_root, 'somefile'), 'w') { |f| f.write 'junk' }
Dor::DigitalStacksService.prune_stacks_dir 'druid:aa123bb4567'
item_pathname = Pathname item_root
expect(File).to_not exist(item_pathname)
expect(File).to_not exist(item_pathname.parent)
end
end

0 comments on commit 418eb4d

Please sign in to comment.