-
Notifications
You must be signed in to change notification settings - Fork 3
/
test_engine.rb
59 lines (48 loc) · 1.42 KB
/
test_engine.rb
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Code Generated by ZenTest v. 3.7.1
# classname: asrt / meth = ratio%
# Engine: 0 / 3 = 0.00%
$:.unshift File.dirname(__FILE__)
require 'helper'
class TestEngine < Test::Unit::TestCase
def setup
require 'engine'
@eng = Engine.new
end
def test_create_path_and_convert
#raise NotImplementedError, 'Need to write test_create_path_and_convert'
end
def test_extract_subpath
assert_equal "to/target.avi", Engine.extract_subpath("/source/path", "/source/path/to/target.avi")
assert_not_equal "", Engine.extract_subpath("", "/source/path/to/target.avi")
end
def test_build_target_path
assert_equal "/target/dir/path/test.mp4", Engine.build_target_path("path/test.avi", "/target/dir")
end
def test_transcode
#raise NotImplementedError, 'Need to write test_transcode'
end
end
class TestFFMpegTranscoder < Test::Unit::TestCase
def setup
require 'engine'
@fft = FFMpegTranscoder.new
end
def test_basic_transcode
input = File.join(TestDir, 'test_files', 'MH_egyptian_pan_L2R.avi')
output = File.join(TestDir, 'tmp.avi')
@fft.transcode(input, output)
# Let's see if the file exists
opn = Pathname.new(output)
assert opn.exist?
opn.delete
end
def test_get_command
input = "foo"
output = 'bar'
ret = @fft.get_command(input, output)
# FIXME: This test sucks
assert ret.include?(input)
assert ret.include?(output)
assert ret.include?("ffmpeg")
end
end