spec/mplayer_edl.spec.rb in sensible-cinema-0.28.1 vs spec/mplayer_edl.spec.rb in sensible-cinema-0.34.0

- old
+ new

@@ -22,23 +22,23 @@ { "mutes" => {5=> 7}, "blank_outs" => {6=>7} } it "should translate verbatim" do a = MplayerEdl.convert_to_edl({ "mutes"=>{105=>145, "46:33.5"=>2801}, "blank_outs" => {6 => 7} } ) # 0 for skip, 1 for mute - a.should == <<EOL + a.should == <<-EOL 6.0 7.0 0 105.0 145.0 1 2793.5 2801.0 1 -EOL + EOL end it "should add to mutes" do a = MplayerEdl.convert_to_edl({ "mutes"=>{105=>106}, "blank_outs" => {110 => 111} }, 1 ) - a.should == <<EOL + a.should == <<-EOL 105.0 107.0 1 110.0 112.0 0 -EOL + EOL end it "should catch overlaps from additions to mutes" do pending do a = MplayerEdl.convert_to_edl({ "mutes"=>{105=>106}, "blank_outs" => {106 => 107} }, 1 ) @@ -49,22 +49,52 @@ end end it "should add to beginning and ending of mutes" do a = MplayerEdl.convert_to_edl({ "mutes"=>{105=>106}, "blank_outs" => {110 => 111} }, 1, 1 ) - a.should == <<EOL + a.should == <<-EOL 104.0 107.0 1 109.0 112.0 0 -EOL + EOL end - it "should accomodate for split sections in some dvd's and order the output" do - a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6,105=>106}, "blank_outs" => {110 => 111}}, 0, 0, [103] ) + it "should accomodate for unordered sections in some dvd's and order the output" do + mplayer_dvd_splits = [103] + a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6,105=>106}, "blank_outs" => {110 => 111}}, 0, 0, mplayer_dvd_splits ) a.should == <<-EOL -2.0 3.0 1 +1.0 4.0 1 5.0 6.0 1 -7.0 8.0 0 +6.0 9.0 0 EOL end + + it "should use non additive mplayer_dvd_splits" do + mplayer_dvd_splits = [103, 150] + a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6,114=>115}}, 0, 0, mplayer_dvd_splits ) + a.should == <<-EOL +5.0 6.0 1 +10.0 13.0 1 + EOL + end + + it "should combine overlaps" do + mplayer_dvd_splits = [103, 12] + a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6, 105 => 106, 120=>121}}, 0, 0, mplayer_dvd_splits ) + a.should == <<-EOL +1.0 8.0 1 + EOL + + end + + it "should use non additive mplayer_dvd_splits 2" do + mplayer_dvd_splits = [103, 47] + a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6,124=>125, 185 => 190}}, 0, 0, mplayer_dvd_splits ) + a.should == <<-EOL +5.0 6.0 1 +20.0 23.0 1 +33.0 42.0 1 + EOL + end + end \ No newline at end of file