Skip to content

Commit

Permalink
test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesPurvis committed Oct 18, 2024
1 parent bff7be2 commit e8ea15a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/ffmpeg/transcoder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ module FFMPEG

it "should transcode the movie with progress given an awesome movie" do
output_file = "#{tmp_path}/awesome_#{SecureRandom.urlsafe_base64}.flv"
FileUtils.rm_f output_file
FileUtils.rm_f output_file if File.exist?(output_file)

transcoder = Transcoder.new(movie, "#{tmp_path}/awesome.flv")
transcoder = Transcoder.new(movie, output_file)
progress_updates = []
transcoder.run { |progress| progress_updates << progress }
expect(transcoder.encoded).to be_valid
expect(progress_updates).to include(0.0, 1.0)
expect(progress_updates.length).to be >= 3
expect(File.exist?("#{tmp_path}/awesome.flv")).to be_truthy
expect(File.exist?(output_file)).to be_truthy
end

it "should transcode the movie with EncodingOptions" do
Expand Down Expand Up @@ -216,6 +216,7 @@ module FFMPEG
pending "should not crash on ISO-8859-1 characters (dont know how to spec this)"

it "should fail when given an invalid movie" do
expect(FFMPEG.logger).to receive(:error).at_least(:once)
movie = Movie.new(__FILE__)
transcoder = Transcoder.new(movie, "#{tmp_path}/fail.flv")
expect { transcoder.run }.to raise_error(FFMPEG::Error, /no output file created/)
Expand Down

0 comments on commit e8ea15a

Please sign in to comment.