##// END OF EJS Templates
scm: filesystem: code clean up unit model test....
scm: filesystem: code clean up unit model test. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5192 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r5072:3f3b6c8fd293
r5072:3f3b6c8fd293
Show More
repository_filesystem_test.rb
55 lines | 1.9 KiB | text/x-ruby | RubyLexer
/ test / unit / repository_filesystem_test.rb
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 # redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../test_helper', __FILE__)
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494
Eric Davis
Upgraded to Rails 2.3.4 (#3597)...
r2773 class RepositoryFilesystemTest < ActiveSupport::TestCase
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 fixtures :projects
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 # No '..' in the repository path
REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/filesystem_repository'
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 def setup
@project = Project.find(1)
Setting.enabled_scm << 'Filesystem' unless Setting.enabled_scm.include?('Filesystem')
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072 assert @repository = Repository::Filesystem.create(
:project => @project, :url => REPOSITORY_PATH)
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 end
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 if File.directory?(REPOSITORY_PATH)
def test_fetch_changesets
@repository.fetch_changesets
@repository.reload
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 assert_equal 0, @repository.changesets.count
assert_equal 0, @repository.changes.count
end
Toshi MARUYAMA
scm: filesystem: code clean up unit model test....
r5072
Jean-Philippe Lang
Adds Filesystem adapter (patch #1393 by Paul R)....
r1494 def test_entries
assert_equal 2, @repository.entries("", 2).size
assert_equal 2, @repository.entries("dir", 3).size
end
def test_cat
assert_equal "TEST CAT\n", @repository.scm.cat("test")
end
else
puts "Filesystem test repository NOT FOUND. Skipping unit tests !!! See doc/RUNNING_TESTS."
def test_fake; assert true end
end
end