Sha256: b13366cf94f881bc1cac52cd353e0282302036339a22c21be29f597eb271e3cc

Contents?: true

Size: 668 Bytes

Versions: 18

Compression:

Stored size: 668 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/fs/temp'

::RSpec.configure do |config|
  config.before do
    videos_temp_dir
  end

  config.after do
    videos_temp_dir.remove
  end

  def videos_temp_dir
    @videos_temp_dir ||= ::EacRubyUtils::Fs::Temp.directory
  end

  def stub_video_source_file
    @stub_video_source_file ||= ::Pathname.new(__dir__).join('videos_files', 'stub_source.mp4')
  end

  def stub_video(ffmpeg_args, output_path = nil)
    output_path ||= videos_temp_dir.file
    ::Ehbrs::Executables.ffmpeg.command.append(
      ['-i', stub_video_source_file.to_s, *ffmpeg_args, output_path.to_s]
    ).execute!

    output_path
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ehbrs-tools-0.37.0 spec/spec_helper/videos.rb
ehbrs-tools-0.36.0 spec/spec_helper/videos.rb
ehbrs-tools-0.35.1 spec/spec_helper/videos.rb
ehbrs-tools-0.35.0 spec/spec_helper/videos.rb
ehbrs-tools-0.34.0 spec/spec_helper/videos.rb
ehbrs-tools-0.33.0 spec/spec_helper/videos.rb
ehbrs-tools-0.32.0 spec/spec_helper/videos.rb
ehbrs-tools-0.31.1 spec/spec_helper/videos.rb
ehbrs-tools-0.31.0 spec/spec_helper/videos.rb
ehbrs-tools-0.30.0 spec/spec_helper/videos.rb
ehbrs-tools-0.29.0 spec/spec_helper/videos.rb
ehbrs-tools-0.28.3 spec/spec_helper/videos.rb
ehbrs-tools-0.28.2 spec/spec_helper/videos.rb
ehbrs-tools-0.28.1 spec/spec_helper/videos.rb
ehbrs-tools-0.28.0 spec/spec_helper/videos.rb
ehbrs-tools-0.27.0 spec/spec_helper/videos.rb
ehbrs-tools-0.26.0 spec/spec_helper/videos.rb
ehbrs-tools-0.25.1 spec/spec_helper/videos.rb