Advertisement
Guest User

Untitled

a guest
Oct 10th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.77 KB | None | 0 0
  1. stubbing
  2. ----------------
  3. subject = TranscodeResolution.new(content_id: "content_stub_id", source_files: source_files, resolutions: resolutions )
  4. subject.stubs(:analyze_sources).returns(["1280x720", "480x360"])
  5. subject.perform
  6. ---------------
  7. class TranscodeResolution
  8.   def initialize(content_id:, source_files:, resolutions: [], preserve_aspect_ratio: 'true')
  9.     @content_id = content_id
  10.     @source_files = source_files
  11.   end
  12.  
  13.  def perform
  14.     if !@resolutions.empty?
  15.       binding.pry
  16.       existing_resolutions = analyze_sources
  17.     end
  18.   end
  19.  
  20.   private
  21.  
  22.   def analyze_sources
  23.     puts "do stuff"
  24.   end
  25. end
  26. -------------
  27.  
  28.  
  29. [1] pry(#<TranscodeResolution>)> analyze_sources
  30. => nil
  31. [2] pry(#<TranscodeResolution>)> analyze_sources
  32. => ["1280x720", "480x360"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement