ohloh_scm / branches / master / test / unit / svn_cat_file_test.rb

history
require File.dirname(__FILE__) + '/../test_helper'

module Scm::Adapters
	class SvnCatFileTest < Scm::Test

		def test_cat_file
			with_svn_repository('svn') do |svn|
expected = <<-EXPECTED
/* Hello, World! */
#include <stdio.h>
main()
{
	printf("Hello, World!\\n");
}
EXPECTED
				assert_equal expected, svn.cat_file(Scm::Commit.new(:token => 1), Scm::Diff.new(:path => "trunk/helloworld.c"))

				assert_equal nil, svn.cat_file(Scm::Commit.new(:token => 1), Scm::Diff.new(:path => "file not found"))
			end
		end
	end
end