spec/ffprober_spec.rb in ffprober-0.3.0 vs spec/ffprober_spec.rb in ffprober-0.3.1

- old
+ new

@@ -2,12 +2,21 @@ require 'spec_helper' describe Ffprober do describe "if no ffprobe is found" do - it "should raise a exception" do + it "should raise a exception if there is no ffmpeg" do Ffprober.stub(:path).and_return("nonexistant") - lambda { @ffprobe = Ffprober::Parser.from_file('spec/assets/301-extracting_a_ruby_gem.m4v') }.should raise_error + expect { + @ffprobe = Ffprober::Parser.from_file('spec/assets/301-extracting_a_ruby_gem.m4v') + }.to raise_error(Errno::ENOENT) end - end + it "should raise a exception if there is no valid ffmpeg" do + Ffprober::FfprobeVersion.stub(:valid?).and_return(false) + + expect { + @ffprobe = Ffprober::Parser.from_file('spec/assets/301-extracting_a_ruby_gem.m4v') + }.to raise_error(ArgumentError) + end + end end