Skip to content

Commit

Permalink
always overwrite collage after taking new image
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaltom committed Jul 5, 2018
1 parent 43a0a7f commit 5c7a4e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/picture_set.rb
Expand Up @@ -38,7 +38,7 @@ def create(date: Time.now.getlocal.strftime(DATE_FORMAT))
# wait until convert jobs are finished
until jobs.none?(&:status) do end
picture_set.create_animation
#background_thread { picture_set.combine_images } if OPTS.render_collage
background_thread { picture_set.combine_images(overwrite: true) } if OPTS.render_collage
(1..4).each { |i| GpioPort.off(GpioPort::GPIO_PORTS["PICTURE#{i}"]) }
GpioPort.off(GpioPort::GPIO_PORTS['PROCESSING'])
picture_set
Expand Down
3 changes: 1 addition & 2 deletions spec/models/picture_set_spec.rb
Expand Up @@ -53,10 +53,10 @@

before do
expect(FileUtils).to receive(:mkdir).with(/fixtures\/filesystem\//)
expect(PictureSet).to receive(:new).and_call_original
end

it 'takes new picture' do
expect(PictureSet).to receive(:new).and_call_original
expect(Syscall).to receive(:execute).with(/gphoto2 --capture-image-and-download/, anything).exactly(4).times
expect(Syscall).to receive(:execute).with(/convert/, anything).exactly(5).times
expect(File).to receive(:exist?).with(/_animation.gif/).and_return(false)
Expand All @@ -67,7 +67,6 @@
end

it 'raises if image capture failed' do
allow(PictureSet).to receive(:new).and_call_original
allow(Syscall).to receive(:execute).with(/gphoto2 --capture-image-and-download/, anything)
allow(GpioPort).to receive(:on)
allow(GpioPort).to receive(:off)
Expand Down

0 comments on commit 5c7a4e1

Please sign in to comment.