spec/unit/processor/ffmpeg_spec.rb in bulldog-0.0.2 vs spec/unit/processor/ffmpeg_spec.rb in bulldog-0.0.3
- old
+ new
@@ -52,11 +52,11 @@
process(options.merge(:on => :event, :with => :ffmpeg), &block)
end
@thing.video.process(:event)
end
- describe "when a simple conversion is performed" do
+ describe "#process" do
before do
video_style :output
end
it "should run ffmpeg" do
@@ -69,9 +69,23 @@
open(log_path, 'w') do |file|
Bulldog.logger = Logger.new(file)
process_video
end
File.read(log_path).should include("[Bulldog] Running: #{ffmpeg}")
+ end
+
+ it "should add an error to the record if convert fails" do
+ video_style :output
+ Bulldog.stubs(:run).returns(nil)
+ process_video
+ @thing.errors.should be_present
+ end
+
+ it "should not add an error to the record if convert succeeds" do
+ video_style :output
+ Bulldog.stubs(:run).returns('')
+ process_video
+ @thing.errors.should_not be_present
end
end
describe "#encode" do
it "should force an encode" do