Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert unit tests to RSpec files - two of the engine tests fail for
mysterious reasons
- Loading branch information
1 parent
e8845e9
commit 9192ed1
Showing
17 changed files
with
111 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$:.unshift File.dirname(__FILE__) | ||
|
||
require 'helper' | ||
require 'lib/daemonize' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
$:.unshift File.dirname(__FILE__) | ||
|
||
require 'helper' | ||
require 'lib/engine' | ||
|
||
describe Engine do | ||
before do | ||
@eng = Engine.new | ||
end | ||
|
||
it "should be able to extract subpaths" do | ||
Engine.extract_subpath("/source/path", "/source/path/to/target.avi").should == "to/target.avi" | ||
Engine.extract_subpath("", "/source/path/to/target.avi").should == "/source/path/to/target.avi" | ||
end | ||
|
||
it "should be able to build paths" do | ||
Engine.build_target_path("path/test.avi", "/target/dir").should == "/target/dir/path/test.mp4" | ||
end | ||
end | ||
|
||
describe FFMpegTranscoder do | ||
before do | ||
@fft = FFMpegTranscoder.new | ||
end | ||
|
||
it "should succeed a basic transcode" do | ||
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) | ||
opn.exist?.should == true | ||
opn.delete | ||
end | ||
|
||
it "should build an FFMpeg command line" do | ||
input = "foo"; output = 'bar' | ||
ret = @fft.get_command(input, output) | ||
|
||
# FIXME: This test sucks | ||
ret.include?(input).should == true | ||
ret.include?(output).should == true | ||
ret.include?("ffmpeg").should == true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
require 'pathname' | ||
require 'test/unit' unless defined? $ZENTEST and $ZENTEST | ||
|
||
TestDir = File.dirname(__FILE__) | ||
|
||
require File.join(TestDir, '..', 'lib', 'config') unless defined? $CONFIG_INCLUDED and $CONFIG_INCLUDED | ||
|
||
path_add TestDir | ||
path_add File.join(TestDir, '..') | ||
path_add File.join(TestDir, '..', 'lib') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$:.unshift File.dirname(__FILE__) | ||
|
||
require 'helper' | ||
require 'lib/main' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
$:.unshift File.dirname(__FILE__) | ||
|
||
require 'helper' | ||
require 'lib/platform' | ||
|
||
describe Platform do | ||
it "should find our bindir" do | ||
Platform.binary_dir.should == (AppConfig::RootDir + "/bin") | ||
end | ||
|
||
it "should find home dir" do | ||
Platform.home_dir.should == "#{ENV['HOME']}" | ||
end | ||
|
||
it "should identify the OS" do | ||
# TODO: This test is blatantly retarded | ||
Platform.os.should == :osx | ||
end | ||
|
||
it "should find external commands" do | ||
Platform.which("ls").should == `which ls` | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$:.unshift File.dirname(__FILE__) | ||
|
||
require 'helper' | ||
require 'lib/state' | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
$:.unshift File.dirname(__FILE__) | ||
|
||
require 'helper' | ||
require 'lib/utility' | ||
|
||
describe "utility functions" do | ||
it "should escape paths" do | ||
escaped_path("/test/Path Containing Spaces").should == '/test/Path\ Containing\ Spaces' | ||
end | ||
|
||
it "should be able to Super Chomp!" do | ||
super_chomp(" chomp").should == "chomp" | ||
super_chomp(" chomp ").should == "chomp" | ||
super_chomp("chomp ").should == "chomp" | ||
end | ||
|
||
it "should be able to verify if a path is file'ish" do | ||
filelike?(__FILE__).should == true | ||
filelike?(TestDir).should == false | ||
filelike?("./foobar").should == false | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.