test/test_movie-renamer.rb in movie-renamer-0.0.19 vs test/test_movie-renamer.rb in movie-renamer-0.0.20
- old
+ new
@@ -1,8 +1,9 @@
require 'helper'
require File.join(File.dirname(__FILE__),'..', 'lib','movie-renamer')
require 'stringio'
+require 'mocha'
class TestMovieRenamer < Test::Unit::TestCase
def setup
@folder = File.expand_path('temp')
@@ -96,10 +97,14 @@
must "sanitize input correctly" do
input = "ain't a very bad movie{}\@# son "
assert_equal "ain't a very bad movie son", MovieRenamer::sanitizeInput(input)
end
-
+ must "parse a movie title" do
+ input = "2010: Odissea Nello Spazio - Stanley Kubrick - 1964.avi"
+ mov = MovieRenamer::Movie.new("test.avi",:title =>"2001: Odissea Nello Spazio",:director=>"Stanley Kubrick",:year=>1964)
+ assert_equal mov, MovieRenamer::parseMovie(input)
+ end
=begin
# test main loop over folder
must "ask for all movies in folder" do
provide_input "no\nno\nno\nno\n"