Mercurial > hg > soundsoftware-site
comparison test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb @ 441:cbce1fd3b1b7 redmine-1.2
Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author | Chris Cannam |
---|---|
date | Mon, 06 Jun 2011 14:24:13 +0100 |
parents | 051f544170fe |
children | cbb26bc654de |
comparison
equal
deleted
inserted
replaced
245:051f544170fe | 441:cbce1fd3b1b7 |
---|---|
5 class BazaarAdapterTest < ActiveSupport::TestCase | 5 class BazaarAdapterTest < ActiveSupport::TestCase |
6 | 6 |
7 REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/bazaar_repository' | 7 REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/bazaar_repository' |
8 REPOSITORY_PATH.gsub!(/\/+/, '/') | 8 REPOSITORY_PATH.gsub!(/\/+/, '/') |
9 | 9 |
10 if File.directory?(REPOSITORY_PATH) | 10 if File.directory?(REPOSITORY_PATH) |
11 def setup | 11 def setup |
12 @adapter = Redmine::Scm::Adapters::BazaarAdapter.new(REPOSITORY_PATH) | 12 @adapter = Redmine::Scm::Adapters::BazaarAdapter.new(REPOSITORY_PATH) |
13 end | 13 end |
14 | 14 |
15 def test_scm_version | 15 def test_scm_version |
23 | 23 |
24 def test_cat | 24 def test_cat |
25 cat = @adapter.cat('directory/document.txt') | 25 cat = @adapter.cat('directory/document.txt') |
26 assert cat =~ /Write the contents of a file as of a given revision to standard output/ | 26 assert cat =~ /Write the contents of a file as of a given revision to standard output/ |
27 end | 27 end |
28 | 28 |
29 def test_annotate | 29 def test_annotate |
30 annotate = @adapter.annotate('doc-mkdir.txt') | 30 annotate = @adapter.annotate('doc-mkdir.txt') |
31 assert_equal 17, annotate.lines.size | 31 assert_equal 17, annotate.lines.size |
32 assert_equal '1', annotate.revisions[0].identifier | 32 assert_equal '1', annotate.revisions[0].identifier |
33 assert_equal 'jsmith@', annotate.revisions[0].author | 33 assert_equal 'jsmith@', annotate.revisions[0].author |
43 else | 43 else |
44 puts "Bazaar test repository NOT FOUND. Skipping unit tests !!!" | 44 puts "Bazaar test repository NOT FOUND. Skipping unit tests !!!" |
45 def test_fake; assert true end | 45 def test_fake; assert true end |
46 end | 46 end |
47 end | 47 end |
48 | |
49 rescue LoadError | 48 rescue LoadError |
50 class BazaarMochaFake < ActiveSupport::TestCase | 49 class BazaarMochaFake < ActiveSupport::TestCase |
51 def test_fake; assert(false, "Requires mocha to run those tests") end | 50 def test_fake; assert(false, "Requires mocha to run those tests") end |
52 end | 51 end |
53 end | 52 end |
54 |