public
Description: Given an Avid ALE file, it will adjust the start, end, and duration times a given amount
Homepage: http://www.bjeanes.com/
Clone URL: git://github.com/bjeanes/ale-adjust.git
bjeanes (author)
Thu May 15 18:47:27 -0700 2008
commit  0e27e2c92f5c02ed6b7a999f7ec43be0ab698689
tree    756c5bd7544c3c250fb6f22f9adc81b408c6a655
parent  602c4f2b517cc37b41c4844fd9b4f277b67d5963
ale-adjust / test / test_frametime.rb
100644 43 lines (35 sloc) 0.892 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'test/unit'
require 'frametime'
 
class TestFrameTime < Test::Unit::TestCase
  
  def initialize(*args)
    super(*args)
    
    @tc = "12:05:10:01"
    @tc2 = "12:05:10:02"
    @tc3 = "12:05:11:02"
    @tc4 = "10:04:11:02"
  end
  
  def test_parses_timecode_correctly
    ft = FrameTime.parse(@tc)
    assert_equal(ft.to_s, @tc)
  end
  
  def test_adds_frame_using_number
    ft = FrameTime.parse(@tc)
    ft.add!(0,1)
    assert_equal(ft.to_s, @tc2)
  end
  
  def test_adds_frame_using_timecode
    ft = FrameTime.parse(@tc)
    ft + "00:00:00:01"
    assert_equal(ft.to_s, @tc2)
  end
  
  def test_adds_second_and_frame_using_numbers
    ft = FrameTime.parse(@tc)
    ft.add!(1,1)
    assert_equal(ft.to_s, @tc3)
  end
  
  def test_minuses_two_hours_and_one_minute_using_timecode
    ft = FrameTime.parse(@tc3)
    ft - "02:01:00:00"
    assert_equal(ft.to_s, @tc4)
  end
end