diff --git a/lib/ohloh_scm/adapters/svn/commits.rb b/lib/ohloh_scm/adapters/svn/commits.rb
index 64530cc6..216497ad 100644
--- a/lib/ohloh_scm/adapters/svn/commits.rb
+++ b/lib/ohloh_scm/adapters/svn/commits.rb
@@ -96,7 +96,7 @@ def deepen_diff(diff, rev)
if (diff.action == 'D' or diff.action == 'A') && is_directory?(diff.path, recurse_rev)
# Deleting or adding a directory. Expand it out to show every file.
recurse_files(diff.path, recurse_rev).collect do |f|
- Scm::Diff.new(:action => diff.action, :path => File.join(diff.path, f))
+ OhlohScm::Diff.new(:action => diff.action, :path => File.join(diff.path, f))
end
else
# An ordinary file action. Just return the diff.
diff --git a/lib/ohloh_scm/commit.rb b/lib/ohloh_scm/commit.rb
index ddb9fa13..2a8e12f0 100644
--- a/lib/ohloh_scm/commit.rb
+++ b/lib/ohloh_scm/commit.rb
@@ -1,4 +1,4 @@
-module Scm
+module OhlohScm
# A commit is a collection of diffs united by a single timestamp, author, and
# message.
#
diff --git a/lib/ohloh_scm/diff.rb b/lib/ohloh_scm/diff.rb
index 1263cb96..83169185 100644
--- a/lib/ohloh_scm/diff.rb
+++ b/lib/ohloh_scm/diff.rb
@@ -1,10 +1,10 @@
-module Scm
+module OhlohScm
# A +Diff+ represents a change to a single file. It can represent the addition or
# deletion of a file, or it can represent a modification of the file contents.
- #
+ #
# Ohloh does not track filename changes. If a file is renamed, Ohloh treats this
# as the deletion of one file and the creation of another.
- #
+ #
# Ohloh does not track directories, only the files within directories.
#
# Don't confuse our use of the word "Diff" with a patch file or the output of the
@@ -22,7 +22,7 @@ class Diff
# 'M' modified
# 'D' deleted
attr_accessor :action
-
+
# The SHA1 hash of the file contents both before and after the change.
# These must be computed using the same method as Git.
attr_accessor :parent_sha1, :sha1
diff --git a/lib/ohloh_scm/parsers/bzr_parser.rb b/lib/ohloh_scm/parsers/bzr_parser.rb
index 9a879e49..acc79bba 100644
--- a/lib/ohloh_scm/parsers/bzr_parser.rb
+++ b/lib/ohloh_scm/parsers/bzr_parser.rb
@@ -30,7 +30,7 @@ def self.internal_parse(buffer, opts)
e.diffs = remove_dupes(e.diffs)
yield e
end
- e = Scm::Commit.new
+ e = OhlohScm::Commit.new
e.diffs = []
next_state = :data
when /^#{indent}revno:\s+(\d+)$/
@@ -98,10 +98,10 @@ def self.parse_diffs(action, line)
# Note that is possible to be renamed to the empty string!
# This happens when a subdirectory is moved to become the root.
before, after = line.scan(/(.+) => ?(.*)/).first
- [ Scm::Diff.new(:action => 'D', :path => before),
- Scm::Diff.new(:action => 'A', :path => after || '' )]
+ [ OhlohScm::Diff.new(:action => 'D', :path => before),
+ OhlohScm::Diff.new(:action => 'A', :path => after || '' )]
else
- [Scm::Diff.new(:action => action, :path => line)]
+ [OhlohScm::Diff.new(:action => action, :path => line)]
end.each do |d|
d.path = strip_trailing_asterisk(d.path)
end
diff --git a/lib/ohloh_scm/parsers/bzr_xml_parser.rb b/lib/ohloh_scm/parsers/bzr_xml_parser.rb
index 32a926c0..325e25e4 100644
--- a/lib/ohloh_scm/parsers/bzr_xml_parser.rb
+++ b/lib/ohloh_scm/parsers/bzr_xml_parser.rb
@@ -18,7 +18,7 @@ def initialize(callback)
def tag_start(name, attrs)
case name
when 'log'
- @commit = Scm::Commit.new
+ @commit = OhlohScm::Commit.new
@commit.diffs = []
when 'affected-files'
@diffs = []
@@ -87,18 +87,18 @@ def parse_diff(action, path, before_path)
case action
# A rename action requires two diffs: one to remove the old filename,
# another to add the new filename.
- #
+ #
# Note that is possible to be renamed to the empty string!
# This happens when a subdirectory is moved to become the root.
when 'renamed'
- diffs = [ Scm::Diff.new(:action => 'D', :path => before_path),
- Scm::Diff.new(:action => 'A', :path => path || '')]
+ diffs = [ OhlohScm::Diff.new(:action => 'D', :path => before_path),
+ OhlohScm::Diff.new(:action => 'A', :path => path || '')]
when 'added'
- diffs = [Scm::Diff.new(:action => 'A', :path => path)]
+ diffs = [OhlohScm::Diff.new(:action => 'A', :path => path)]
when 'modified'
- diffs = [Scm::Diff.new(:action => 'M', :path => path)]
+ diffs = [OhlohScm::Diff.new(:action => 'M', :path => path)]
when 'removed'
- diffs = [Scm::Diff.new(:action => 'D', :path => path)]
+ diffs = [OhlohScm::Diff.new(:action => 'D', :path => path)]
end
diffs.each do |d|
d.path = strip_trailing_asterisk(d.path)
@@ -108,11 +108,11 @@ def parse_diff(action, path, before_path)
def strip_trailing_asterisk(path)
path[-1..-1] == '*' ? path[0..-2] : path
- end
+ end
def remove_dupes(diffs)
BzrXmlParser.remove_dupes(diffs)
- end
+ end
end
@@ -133,14 +133,14 @@ def self.scm
def self.remove_dupes(diffs)
# Bazaar may report that a file was added and modified in a single commit.
# Reduce these cases to a single 'A' action.
- diffs.delete_if do |d|
+ diffs.delete_if do |d|
d.action == 'M' && diffs.select { |x| x.path == d.path && x.action == 'A' }.any?
- end
+ end
# Bazaar may report that a file was both deleted and added in a single commit.
# Reduce these cases to a single 'M' action.
- diffs.each do |d|
- d.action = 'M' if diffs.select { |x| x.path == d.path }.size > 1
+ diffs.each do |d|
+ d.action = 'M' if diffs.select { |x| x.path == d.path }.size > 1
end.uniq
end
diff --git a/lib/ohloh_scm/parsers/cvs_parser.rb b/lib/ohloh_scm/parsers/cvs_parser.rb
index a8d86b20..99a49816 100644
--- a/lib/ohloh_scm/parsers/cvs_parser.rb
+++ b/lib/ohloh_scm/parsers/cvs_parser.rb
@@ -139,7 +139,7 @@ def self.read_commit(io, filename, commit_number, should_yield)
should_yield = false if commit_number == '1.1' and state == 'dead'
message = read_message(io)
if should_yield
- commit = Scm::Commit.new
+ commit = OhlohScm::Commit.new
commit.token = committer_date[0..18]
commit.committer_date = Time.parse(committer_date[0..18] + ' +0000').utc
commit.committer_name = committer_name
diff --git a/lib/ohloh_scm/parsers/git_parser.rb b/lib/ohloh_scm/parsers/git_parser.rb
index 9b2a8ee7..8a48a46d 100644
--- a/lib/ohloh_scm/parsers/git_parser.rb
+++ b/lib/ohloh_scm/parsers/git_parser.rb
@@ -27,7 +27,7 @@ def self.internal_parse(io, opts)
when /^commit ([a-z0-9]{40,40})$/
sha1 = $1
yield e if e
- e = Scm::Commit.new
+ e = OhlohScm::Commit.new
e.diffs = []
e.token = sha1
e.author_name = ANONYMOUS
@@ -53,7 +53,7 @@ def self.internal_parse(io, opts)
elsif state == :diffs
if line =~ /^([ADM])\t(.+)$/
- e.diffs << Scm::Diff.new( :action => $1, :path => $2)
+ e.diffs << OhlohScm::Diff.new( :action => $1, :path => $2)
end
else
diff --git a/lib/ohloh_scm/parsers/git_styled_parser.rb b/lib/ohloh_scm/parsers/git_styled_parser.rb
index fba110e0..beec97ba 100644
--- a/lib/ohloh_scm/parsers/git_styled_parser.rb
+++ b/lib/ohloh_scm/parsers/git_styled_parser.rb
@@ -35,7 +35,7 @@ def self.internal_parse(io, opts)
if line =~ /^Commit: ([a-z0-9]+)$/
sha1 = $1
yield e if e
- e = Scm::Commit.new
+ e = OhlohScm::Commit.new
e.diffs = []
e.token = sha1
e.author_name = ANONYMOUS
@@ -70,7 +70,7 @@ def self.internal_parse(io, opts)
elsif line =~ /:([0-9]+) ([0-9]+) ([a-z0-9]+) ([a-z0-9]+) ([A-Z])\t"?(.+[^"])"?$/
# Submodules have a file mode of '160000', which indicates a "gitlink"
# We ignore submodules completely.
- e.diffs << Scm::Diff.new( :action => $5, :path => $6, :sha1 => $4, :parent_sha1 => $3 ) unless $1=='160000' || $2=='160000'
+ e.diffs << OhlohScm::Diff.new( :action => $5, :path => $6, :sha1 => $4, :parent_sha1 => $3 ) unless $1=='160000' || $2=='160000'
end
else
diff --git a/lib/ohloh_scm/parsers/hg_parser.rb b/lib/ohloh_scm/parsers/hg_parser.rb
index ea753f28..48cf9cee 100644
--- a/lib/ohloh_scm/parsers/hg_parser.rb
+++ b/lib/ohloh_scm/parsers/hg_parser.rb
@@ -17,7 +17,7 @@ def self.internal_parse(buffer, opts)
case l
when /^changeset:\s+\d+:([0-9a-f]+)/
yield e if e && block_given?
- e = Scm::Commit.new
+ e = OhlohScm::Commit.new
e.diffs = []
e.token = $1
when /^user:\s+(.+?)(\s+<(.+)>)?$/
@@ -27,7 +27,7 @@ def self.internal_parse(buffer, opts)
e.committer_date = Time.parse($1).utc
when /^files:\s+(.+)/
($1 || '').split(' ').each do |file|
- e.diffs << Scm::Diff.new(:action => '?', :path => file)
+ e.diffs << OhlohScm::Diff.new(:action => '?', :path => file)
end
when /^summary:\s+(.+)/
e.message = $1
diff --git a/lib/ohloh_scm/parsers/hg_styled_parser.rb b/lib/ohloh_scm/parsers/hg_styled_parser.rb
index 811d8975..2dc6e753 100644
--- a/lib/ohloh_scm/parsers/hg_styled_parser.rb
+++ b/lib/ohloh_scm/parsers/hg_styled_parser.rb
@@ -25,7 +25,7 @@ def self.internal_parse(buffer, opts)
if state == :data
case l
when /^changeset:\s+([0-9a-f]+)/
- e = Scm::Commit.new
+ e = OhlohScm::Commit.new
e.diffs = []
e.token = $1
when /^user:\s+(.+?)(\s+<(.+)>)?$/
@@ -46,7 +46,7 @@ def self.internal_parse(buffer, opts)
if l == "__END_FILES__\n"
next_state = :data
elsif l =~ /^([MAD]) (.+)$/
- e.diffs << Scm::Diff.new(:action => $1, :path => $2)
+ e.diffs << OhlohScm::Diff.new(:action => $1, :path => $2)
end
elsif state == :long_comment
diff --git a/lib/ohloh_scm/parsers/svn_parser.rb b/lib/ohloh_scm/parsers/svn_parser.rb
index 5fc65b2b..7977649f 100644
--- a/lib/ohloh_scm/parsers/svn_parser.rb
+++ b/lib/ohloh_scm/parsers/svn_parser.rb
@@ -13,7 +13,7 @@ def self.internal_parse(buffer, opts)
next_state = state
if state == :data
if l =~ /^r(\d+) \| (.*) \| (\d+-\d+-\d+ .*) \(.*\) \| .*/
- e = Scm::Commit.new
+ e = OhlohScm::Commit.new
e.token = $1.to_i
e.committer_name = $2
e.committer_date = Time.parse($3).utc
@@ -26,7 +26,7 @@ def self.internal_parse(buffer, opts)
elsif state == :diffs
if l =~ /^ (\w) ([^\(\)]+)( \(from (.+):(\d+)\))?$/
e.diffs ||= []
- e.diffs << Scm::Diff.new(:action => $1, :path => $2, :from_path => $4, :from_revision => $5.to_i)
+ e.diffs << OhlohScm::Diff.new(:action => $1, :path => $2, :from_path => $4, :from_revision => $5.to_i)
else
next_state = :comment
end
diff --git a/lib/ohloh_scm/parsers/svn_xml_parser.rb b/lib/ohloh_scm/parsers/svn_xml_parser.rb
index 6eae2954..bfac5854 100644
--- a/lib/ohloh_scm/parsers/svn_xml_parser.rb
+++ b/lib/ohloh_scm/parsers/svn_xml_parser.rb
@@ -15,11 +15,11 @@ def initialize(callback)
def tag_start(name, attrs)
case name
when 'logentry'
- @commit = Scm::Commit.new
+ @commit = OhlohScm::Commit.new
@commit.diffs = []
@commit.token = attrs['revision'].to_i
when 'path'
- @diff = Scm::Diff.new(:action => attrs['action'],
+ @diff = OhlohScm::Diff.new(:action => attrs['action'],
:from_path => attrs['copyfrom-path'],
:from_revision => attrs['copyfrom-rev'].to_i)
end
diff --git a/lib/ohloh_scm/scratch_dir.rb b/lib/ohloh_scm/scratch_dir.rb
index 4eaa06a5..b68c4fb4 100644
--- a/lib/ohloh_scm/scratch_dir.rb
+++ b/lib/ohloh_scm/scratch_dir.rb
@@ -1,7 +1,7 @@
require 'fileutils'
# A utility class to manage the creation and automatic cleanup of temporary directories.
-module Scm
+module OhlohScm
class ScratchDir
attr_reader :path
diff --git a/lib/ohloh_scm/version.rb b/lib/ohloh_scm/version.rb
index 2868efe2..3e692ad5 100644
--- a/lib/ohloh_scm/version.rb
+++ b/lib/ohloh_scm/version.rb
@@ -1,4 +1,4 @@
-module Scm
+module OhlohScm
module Version
STRING = '2.0.0'
end
diff --git a/ohloh_scm.gemspec b/ohloh_scm.gemspec
index aaa3b7ba..0de6e165 100644
--- a/ohloh_scm.gemspec
+++ b/ohloh_scm.gemspec
@@ -4,7 +4,7 @@ require 'ohloh_scm/version'
Gem::Specification.new do |gem|
gem.name = 'ohloh_scm'
- gem.version = Scm::Version::STRING
+ gem.version = OhlohScm::Version::STRING
gem.authors = ["BlackDuck Software"]
gem.email = ["info@openhub.net"]
gem.summary = %[Source Control Management]
diff --git a/test/test_helper.rb b/test/test_helper.rb
index f8ddbba7..cfd4d926 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -17,7 +17,7 @@
DATA_DIR = File.expand_path(File.join(TEST_DIR, 'data'))
end
-class Scm::Test < Test::Unit::TestCase
+class OhlohScm::Test < Test::Unit::TestCase
# For reasons unknown, the base class defines a default_test method to throw a failure.
# We override it with a no-op to prevent this 'helpful' feature.
def default_test
@@ -48,7 +48,7 @@ def assert_buffers_equal(expected, actual)
end
def with_repository(type, name)
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
if Dir.entries(REPO_DIR).include?(name)
`cp -R #{File.join(REPO_DIR, name)} #{dir}`
elsif Dir.entries(REPO_DIR).include?(name + '.tgz')
diff --git a/test/unit/abstract_adapter_test.rb b/test/unit/abstract_adapter_test.rb
index 4e5c5be7..762ad3a3 100644
--- a/test/unit/abstract_adapter_test.rb
+++ b/test/unit/abstract_adapter_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class AbstractAdapterTest < Scm::Test
+ class AbstractAdapterTest < OhlohScm::Test
def test_simple_validation
scm = AbstractAdapter.new()
assert !scm.valid?
@@ -74,7 +74,7 @@ def test_shellout
stdout = AbstractAdapter.run(cmd)
assert_equal "Hello World\n", stdout
end
-
+
def test_shellout_with_stderr
cmd = %q( ruby -e" t = 'Hello World'; STDOUT.puts t; STDERR.puts t " )
stdout, stderr, status = AbstractAdapter.run_with_err(cmd)
@@ -82,7 +82,7 @@ def test_shellout_with_stderr
assert_equal "Hello World\n", stdout
assert_equal "Hello World\n", stderr
end
-
+
def test_shellout_large_output
cat = 'ruby -e" puts Array.new(65536){ 42 } "'
stdout = AbstractAdapter.run(cat)
@@ -91,7 +91,7 @@ def test_shellout_large_output
def test_shellout_error
cmd = "false"
- assert_raise RuntimeError do
+ assert_raise RuntimeError do
stdout = AbstractAdapter.run(cmd)
end
end
diff --git a/test/unit/adapter_factory_test.rb b/test/unit/adapter_factory_test.rb
index 977d0557..a298ff5f 100644
--- a/test/unit/adapter_factory_test.rb
+++ b/test/unit/adapter_factory_test.rb
@@ -1,10 +1,10 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class FactoryTest < Scm::Test
+ class FactoryTest < OhlohScm::Test
def test_factory_hg
- Scm::ScratchDir.new do |path|
+ OhlohScm::ScratchDir.new do |path|
`cd #{path} && hg init`
hg = Factory.from_path(path)
assert hg.is_a?(HgAdapter)
@@ -13,7 +13,7 @@ def test_factory_hg
end
def test_factory_bzr
- Scm::ScratchDir.new do |path|
+ OhlohScm::ScratchDir.new do |path|
`cd #{path} && bzr init`
bzr = Factory.from_path(path)
assert bzr.is_a?(BzrAdapter)
@@ -22,7 +22,7 @@ def test_factory_bzr
end
def test_factory_git
- Scm::ScratchDir.new do |path|
+ OhlohScm::ScratchDir.new do |path|
`cd #{path} && git init`
git = Factory.from_path(path)
assert git.is_a?(GitAdapter)
@@ -31,7 +31,7 @@ def test_factory_git
end
def test_factory_svn
- Scm::ScratchDir.new do |path|
+ OhlohScm::ScratchDir.new do |path|
`cd #{path} && svnadmin create foo`
svn = Factory.from_path(File.join(path, 'foo'))
assert svn.is_a?(SvnAdapter)
@@ -40,7 +40,7 @@ def test_factory_svn
end
def test_factory_svn_checkout
- Scm::ScratchDir.new do |path|
+ OhlohScm::ScratchDir.new do |path|
`cd #{path} && svnadmin create foo`
`cd #{path} && svn co file://#{File.expand_path(File.join(path, 'foo'))} bar`
svn = Factory.from_path(File.join(path, 'bar'))
@@ -53,7 +53,7 @@ def test_factory_svn_checkout
def test_factory_from_cvs_checkout
with_cvs_repository('cvs', 'simple') do |cvs|
- Scm::ScratchDir.new do |path|
+ OhlohScm::ScratchDir.new do |path|
`cd #{path} && cvsnt -d #{File.expand_path(cvs.url)} co simple 2> /dev/null`
factory_response = Factory.from_path(File.join(path, 'simple'))
assert factory_response.is_a?(CvsAdapter)
diff --git a/test/unit/array_writer_test.rb b/test/unit/array_writer_test.rb
index 037843c2..86a3d32b 100644
--- a/test/unit/array_writer_test.rb
+++ b/test/unit/array_writer_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class ArrayWriterTest < Scm::Test
+ class ArrayWriterTest < OhlohScm::Test
def test_basic
diff --git a/test/unit/bzr_cat_file_test.rb b/test/unit/bzr_cat_file_test.rb
index 58bd4169..f7b08d88 100644
--- a/test/unit/bzr_cat_file_test.rb
+++ b/test/unit/bzr_cat_file_test.rb
@@ -2,7 +2,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class BzrCatFileTest < Scm::Test
+ class BzrCatFileTest < OhlohScm::Test
def test_cat_file
with_bzr_repository('bzr') do |bzr|
@@ -11,12 +11,12 @@ def test_cat_file
second line
EXPECTED
assert_equal expected,
- bzr.cat_file(Scm::Commit::new(:token => 6),
- Scm::Diff.new(:path => "file1.txt"))
+ bzr.cat_file(OhlohScm::Commit::new(:token => 6),
+ OhlohScm::Diff.new(:path => "file1.txt"))
# file2.txt has been removed in commit #5
assert_equal nil, bzr.cat_file(bzr.head,
- Scm::Diff.new(:path => "file2.txt"))
+ OhlohScm::Diff.new(:path => "file2.txt"))
end
end
@@ -27,10 +27,10 @@ def test_cat_file_non_ascii_name
second line
EXPECTED
assert_equal expected,
- bzr.cat_file(Scm::Commit::new(:token => 7),
- Scm::Diff.new(:path => "Cédric.txt"))
- end
- end
+ bzr.cat_file(OhlohScm::Commit::new(:token => 7),
+ OhlohScm::Diff.new(:path => "Cédric.txt"))
+ end
+ end
def test_cat_file_parent
with_bzr_repository('bzr') do |bzr|
@@ -39,16 +39,16 @@ def test_cat_file_parent
second line
EXPECTED
assert_equal expected,
- bzr.cat_file_parent(Scm::Commit::new(:token => 6),
- Scm::Diff.new(:path => "file1.txt"))
+ bzr.cat_file_parent(OhlohScm::Commit::new(:token => 6),
+ OhlohScm::Diff.new(:path => "file1.txt"))
# file2.txt has been removed in commit #5
expected = <<-EXPECTED
another file
EXPECTED
assert_equal expected,
- bzr.cat_file_parent(Scm::Commit.new(:token => 5),
- Scm::Diff.new(:path => "file2.txt"))
+ bzr.cat_file_parent(OhlohScm::Commit.new(:token => 5),
+ OhlohScm::Diff.new(:path => "file2.txt"))
end
end
diff --git a/test/unit/bzr_commits_test.rb b/test/unit/bzr_commits_test.rb
index fa912a50..755ebcd8 100644
--- a/test/unit/bzr_commits_test.rb
+++ b/test/unit/bzr_commits_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class BzrCommitsTest < Scm::Test
+ class BzrCommitsTest < OhlohScm::Test
def test_commit_count
with_bzr_repository('bzr') do |bzr|
@@ -63,7 +63,7 @@ def test_commit_tokens_trunk_only_false
assert_equal [
'test@example.com-20090206214301-s93cethy9atcqu9h',
'test@example.com-20090206214451-lzjngefdyw3vmgms',
- 'test@example.com-20090206214350-rqhdpz92l11eoq2t', # branch commit
+ 'test@example.com-20090206214350-rqhdpz92l11eoq2t', # branch commit
'test@example.com-20090206214515-21lkfj3dbocao5pr' # merge commit
], bzr.commit_tokens(:trunk_only => false)
end
@@ -95,8 +95,8 @@ def test_nested_branches_commit_tokens_trunk_only_false
'test@example.com-20110803170648-o0xcbni7lwp97azj',
'test@example.com-20110803170818-v44umypquqg8migo'
], bzr.commit_tokens(:trunk_only => false)
- end
- end
+ end
+ end
def test_nested_branches_commit_tokens_trunk_only_true
with_bzr_repository('bzr_with_nested_branches') do |bzr|
@@ -109,15 +109,15 @@ def test_nested_branches_commit_tokens_trunk_only_true
'obnox@samba.org-20090204004942-73rnw0izen42f154',
'test@example.com-20110803170818-v44umypquqg8migo'
], bzr.commit_tokens(:trunk_only => true)
- end
- end
+ end
+ end
def test_commits_trunk_only_false
with_bzr_repository('bzr_with_branch') do |bzr|
assert_equal [
'test@example.com-20090206214301-s93cethy9atcqu9h',
'test@example.com-20090206214451-lzjngefdyw3vmgms',
- 'test@example.com-20090206214350-rqhdpz92l11eoq2t', # branch commit
+ 'test@example.com-20090206214350-rqhdpz92l11eoq2t', # branch commit
'test@example.com-20090206214515-21lkfj3dbocao5pr' # merge commit
], bzr.commits(:trunk_only => false).map { |c| c.token }
end
@@ -163,8 +163,8 @@ def test_nested_branches_commits_trunk_only_false
'test@example.com-20110803170648-o0xcbni7lwp97azj',
'test@example.com-20110803170818-v44umypquqg8migo'
], bzr.commits(:trunk_only => false).map { |c| c.token }
- end
- end
+ end
+ end
def test_nested_branches_commits_trunk_only_true
with_bzr_repository('bzr_with_nested_branches') do |bzr|
@@ -177,8 +177,8 @@ def test_nested_branches_commits_trunk_only_true
'obnox@samba.org-20090204004942-73rnw0izen42f154',
'test@example.com-20110803170818-v44umypquqg8migo'
], bzr.commits(:trunk_only => true).map { |c| c.token }
- end
- end
+ end
+ end
def test_commits
with_bzr_repository('bzr') do |bzr|
@@ -345,7 +345,7 @@ def test_committer_and_author_name
assert_equal 'Abhay Mujumdar', commits[0].committer_name
assert_equal nil, commits[0].author_name
assert_equal nil, commits[0].author_email
-
+
assert_equal 'Updated.', commits[1].message
assert_equal 'Abhay Mujumdar', commits[1].committer_name
assert_equal 'John Doe', commits[1].author_name
diff --git a/test/unit/bzr_head_test.rb b/test/unit/bzr_head_test.rb
index c718b5d9..47e7a809 100644
--- a/test/unit/bzr_head_test.rb
+++ b/test/unit/bzr_head_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class BzrHeadTest < Scm::Test
+ class BzrHeadTest < OhlohScm::Test
def test_head_and_parents
with_bzr_repository('bzr') do |bzr|
diff --git a/test/unit/bzr_misc_test.rb b/test/unit/bzr_misc_test.rb
index acd769aa..ec2fcf6a 100644
--- a/test/unit/bzr_misc_test.rb
+++ b/test/unit/bzr_misc_test.rb
@@ -2,7 +2,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class BzrMiscTest < Scm::Test
+ class BzrMiscTest < OhlohScm::Test
def test_exist
save_bzr = nil
@@ -26,7 +26,7 @@ def test_ls_tree
def test_export
with_bzr_repository('bzr') do |bzr|
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
bzr.export(dir)
assert_equal ['.', '..', 'Cédric.txt', 'file1.txt', 'file3.txt', 'file4.txt', 'file5.txt'], Dir.entries(dir).sort
end
diff --git a/test/unit/bzr_parser_test.rb b/test/unit/bzr_parser_test.rb
index b67d4c81..c52ea2df 100644
--- a/test/unit/bzr_parser_test.rb
+++ b/test/unit/bzr_parser_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class BzrParserTest < Scm::Test
+ class BzrParserTest < OhlohScm::Test
def test_empty_array
assert_equal([], BzrParser.parse(''))
@@ -305,8 +305,8 @@ def test_rename
end
def test_remove_dupes_add_remove
- diffs = BzrParser.remove_dupes([ Scm::Diff.new(:action => "A", :path => "foo"),
- Scm::Diff.new(:action => "D", :path => "foo") ])
+ diffs = BzrParser.remove_dupes([ OhlohScm::Diff.new(:action => "A", :path => "foo"),
+ OhlohScm::Diff.new(:action => "D", :path => "foo") ])
assert_equal 1, diffs.size
assert_equal 'M', diffs.first.action
assert_equal 'foo', diffs.first.path
@@ -378,9 +378,9 @@ def test_comment_that_contains_dashes
This is a tricky commit message to confirm fix
to Ticket 5. We're including a line of dashes in
the message that resembles a log delimiter.
-
+
------------------------------------------------------------
-
+
Happy parsing!
added:
goodbyeworld.c
diff --git a/test/unit/bzr_pull_test.rb b/test/unit/bzr_pull_test.rb
index 1d05f76d..4f0bbd0c 100644
--- a/test/unit/bzr_pull_test.rb
+++ b/test/unit/bzr_pull_test.rb
@@ -1,11 +1,11 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class BzrPullTest < Scm::Test
+ class BzrPullTest < OhlohScm::Test
def test_pull
with_bzr_repository('bzr') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = BzrAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
diff --git a/test/unit/bzr_push_test.rb b/test/unit/bzr_push_test.rb
index ef162284..1b1df3d5 100644
--- a/test/unit/bzr_push_test.rb
+++ b/test/unit/bzr_push_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class BzrPushTest < Scm::Test
+ class BzrPushTest < OhlohScm::Test
def test_hostname
assert !BzrAdapter.new.hostname
@@ -36,7 +36,7 @@ def test_bzr_path
def test_push
with_bzr_repository('bzr') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = BzrAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
diff --git a/test/unit/bzr_validation_test.rb b/test/unit/bzr_validation_test.rb
index 10e488dc..c4f2d201 100644
--- a/test/unit/bzr_validation_test.rb
+++ b/test/unit/bzr_validation_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class BzrValidationTest < Scm::Test
+ class BzrValidationTest < OhlohScm::Test
def test_rejected_urls
[ nil, "", "foo", "http:/", "http:://", "http://", "http://a",
"www.selenic.com/repo/hello", # missing a protool prefix
@@ -21,8 +21,8 @@ def test_accepted_urls
"http://www.selenic.com:80/repo/hello",
"https://www.selenic.com/repo/hello",
"bzr://www.selenic.com/repo/hello",
- "lp:foobar",
- "lp:~foobar/bar",
+ "lp:foobar",
+ "lp:~foobar/bar",
].each do |url|
bzr = BzrAdapter.new(:url => url, :public_urls_only => true)
assert !bzr.validate_url
diff --git a/test/unit/bzr_xml_parser_test.rb b/test/unit/bzr_xml_parser_test.rb
index 9a50e3fc..04049cd8 100644
--- a/test/unit/bzr_xml_parser_test.rb
+++ b/test/unit/bzr_xml_parser_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class BzrXmlParserTest < Scm::Test
+ class BzrXmlParserTest < OhlohScm::Test
def test_empty_array
assert_equal([], BzrXmlParser.parse(''))
@@ -10,7 +10,7 @@ def test_empty_array
def test_empty_xml
assert_equal("\n\n\n", BzrXmlParser.parse('', :writer => XmlWriter.new))
end
-
+
def test_basic_xml
xml = <<-XML
@@ -31,7 +31,7 @@ def test_basic_xml
commits = BzrXmlParser.parse(xml)
assert_equal 1, commits.size
c = commits.first
- assert_equal 0, c.diffs.size
+ assert_equal 0, c.diffs.size
assert_equal "Renamed test1.txt to subdir/test_b.txt, removed test2.txt and added test_a.txt.", c.message
assert_equal "test@example.com-20110725174345-brbpkwumeh07aoh8", c.token
end
@@ -71,7 +71,7 @@ def test_verbose_xml
assert_equal "test2.txt", c.diffs[0].path
assert_equal "D", c.diffs[0].action
-
+
assert_equal "test_a.txt", c.diffs[1].path
assert_equal "A", c.diffs[1].action
@@ -83,9 +83,9 @@ def test_verbose_xml
end
# When an directory is deleted, bzr outputs one delete entry
- # per file and one for the directory. For empty dirs, there
- # is only one directory remove entry.
- # Ohloh keeps file delete entries but ignores directory
+ # per file and one for the directory. For empty dirs, there
+ # is only one directory remove entry.
+ # Ohloh keeps file delete entries but ignores directory
# delete entry.
def test_ignore_dir_delete_xml
xml = <<-XML
@@ -114,7 +114,7 @@ def test_ignore_dir_delete_xml
XML
commits = BzrXmlParser.parse(xml)
assert_equal 1, commits.size
-
+
c = commits.first
assert_equal 1, c.diffs.size
assert_equal "uspace/lib/net/include/nil_interface.h", c.diffs.first.path
@@ -243,12 +243,12 @@ def test_different_author_and_committer
assert_equal "test", c.committer_name
assert_equal "test@example.com", c.committer_email
assert_equal nil, c.author_name
- assert_equal nil, c.author_email
+ assert_equal nil, c.author_email
end
def test_rename
xml = <<-XML
-
+
10
test@example.com-20110725174345-brbpkwumeh07aoh8
@@ -265,7 +265,7 @@ def test_rename
-
+
XML
commits = BzrXmlParser.parse(xml)
assert_equal 1, commits.size
@@ -278,21 +278,21 @@ def test_rename
end
def test_remove_dupes_add_remove
- diffs = BzrXmlParser.remove_dupes([ Scm::Diff.new(:action => "A", :path => "foo"),
- Scm::Diff.new(:action => "D", :path => "foo") ])
+ diffs = BzrXmlParser.remove_dupes([ OhlohScm::Diff.new(:action => "A", :path => "foo"),
+ OhlohScm::Diff.new(:action => "D", :path => "foo") ])
assert_equal 1, diffs.size
assert_equal 'M', diffs.first.action
assert_equal 'foo', diffs.first.path
- end
+ end
- # A complex delete/rename/modify test.
- # Removed test_a.txt, Renamed test3.txt to test_a.txt, edited test_a.txt
- #
+ # A complex delete/rename/modify test.
+ # Removed test_a.txt, Renamed test3.txt to test_a.txt, edited test_a.txt
+ #
# This is what Ohloh expects to see:
- #
- # D test3.txt
+ #
+ # D test3.txt
# M test_a.txt
- #
+ #
def test_complex_rename
xml = <<-XML
diff --git a/test/unit/bzrlib_cat_file_test.rb b/test/unit/bzrlib_cat_file_test.rb
index 2d02329d..3579606b 100644
--- a/test/unit/bzrlib_cat_file_test.rb
+++ b/test/unit/bzrlib_cat_file_test.rb
@@ -2,7 +2,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class BzrlibCatFileTest < Scm::Test
+ class BzrlibCatFileTest < OhlohScm::Test
def test_cat_file
with_bzrlib_repository('bzr') do |bzr|
@@ -11,12 +11,12 @@ def test_cat_file
second line
EXPECTED
assert_equal expected,
- bzr.cat_file(Scm::Commit::new(:token => 6),
- Scm::Diff.new(:path => "file1.txt"))
+ bzr.cat_file(OhlohScm::Commit::new(:token => 6),
+ OhlohScm::Diff.new(:path => "file1.txt"))
# file2.txt has been removed in commit #5
assert_equal nil, bzr.cat_file(bzr.head,
- Scm::Diff.new(:path => "file2.txt"))
+ OhlohScm::Diff.new(:path => "file2.txt"))
end
end
@@ -27,8 +27,8 @@ def test_cat_file_non_ascii_name
second line
EXPECTED
assert_equal expected,
- bzr.cat_file(Scm::Commit::new(:token => 7),
- Scm::Diff.new(:path => "Cédric.txt"))
+ bzr.cat_file(OhlohScm::Commit::new(:token => 7),
+ OhlohScm::Diff.new(:path => "Cédric.txt"))
end
end
@@ -39,16 +39,16 @@ def test_cat_file_parent
second line
EXPECTED
assert_equal expected,
- bzr.cat_file_parent(Scm::Commit::new(:token => 6),
- Scm::Diff.new(:path => "file1.txt"))
+ bzr.cat_file_parent(OhlohScm::Commit::new(:token => 6),
+ OhlohScm::Diff.new(:path => "file1.txt"))
# file2.txt has been removed in commit #5
expected = <<-EXPECTED
another file
EXPECTED
assert_equal expected,
- bzr.cat_file_parent(Scm::Commit.new(:token => 5),
- Scm::Diff.new(:path => "file2.txt"))
+ bzr.cat_file_parent(OhlohScm::Commit.new(:token => 5),
+ OhlohScm::Diff.new(:path => "file2.txt"))
end
end
diff --git a/test/unit/bzrlib_head_test.rb b/test/unit/bzrlib_head_test.rb
index a9831dc6..12e4268d 100644
--- a/test/unit/bzrlib_head_test.rb
+++ b/test/unit/bzrlib_head_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class BzrBzrlibHeadTest < Scm::Test
+ class BzrBzrlibHeadTest < OhlohScm::Test
def test_head_and_parents
with_bzrlib_repository('bzr') do |bzr|
diff --git a/test/unit/cvs_branch_number_test.rb b/test/unit/cvs_branch_number_test.rb
index 17cf3aea..4b5df6ee 100644
--- a/test/unit/cvs_branch_number_test.rb
+++ b/test/unit/cvs_branch_number_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class CvsBranchNumberTest < Scm::Test
+ class CvsBranchNumberTest < OhlohScm::Test
def test_basic
assert_equal [1,1], BranchNumber.new('1.1').to_a
assert_equal [1234,1234], BranchNumber.new('1234.1234').to_a
diff --git a/test/unit/cvs_commits_test.rb b/test/unit/cvs_commits_test.rb
index 4a2e92f7..b2013804 100644
--- a/test/unit/cvs_commits_test.rb
+++ b/test/unit/cvs_commits_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class CvsCommitsTest < Scm::Test
+ class CvsCommitsTest < OhlohScm::Test
def test_commits
with_cvs_repository('cvs', 'simple') do |cvs|
diff --git a/test/unit/cvs_convert_test.rb b/test/unit/cvs_convert_test.rb
index 80550928..4f8550b1 100644
--- a/test/unit/cvs_convert_test.rb
+++ b/test/unit/cvs_convert_test.rb
@@ -1,11 +1,11 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class CvsConvertTest < Scm::Test
+ class CvsConvertTest < OhlohScm::Test
def test_basic_convert
with_cvs_repository('cvs', 'simple') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = GitAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
diff --git a/test/unit/cvs_misc_test.rb b/test/unit/cvs_misc_test.rb
index fa6d2d03..a2d202ec 100644
--- a/test/unit/cvs_misc_test.rb
+++ b/test/unit/cvs_misc_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class CvsMiscTest < Scm::Test
+ class CvsMiscTest < OhlohScm::Test
def test_local_directory_trim
r = CvsAdapter.new(:url => "/Users/robin/cvs_repo/", :module_name => "simple")
assert_equal "/Users/robin/cvs_repo/simple/foo.rb", r.trim_directory('/Users/robin/cvs_repo/simple/foo.rb')
diff --git a/test/unit/cvs_parser_test.rb b/test/unit/cvs_parser_test.rb
index 33dc473b..2af1c97d 100644
--- a/test/unit/cvs_parser_test.rb
+++ b/test/unit/cvs_parser_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class CvsParserTest < Scm::Test
+ class CvsParserTest < OhlohScm::Test
def test_basic
assert_convert(CvsParser, DATA_DIR + '/basic.rlog', DATA_DIR + '/basic.ohlog')
diff --git a/test/unit/cvs_validation_test.rb b/test/unit/cvs_validation_test.rb
index 6d12c43f..1f04a63b 100644
--- a/test/unit/cvs_validation_test.rb
+++ b/test/unit/cvs_validation_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class CvsValidationTest < Scm::Test
+ class CvsValidationTest < OhlohScm::Test
def test_rejected_urls
[ nil, "", "foo", "http:/", "http:://", "http://", "http://a",
":pserver", # that's not enough
diff --git a/test/unit/git_cat_file_test.rb b/test/unit/git_cat_file_test.rb
index 7186af27..900c8561 100644
--- a/test/unit/git_cat_file_test.rb
+++ b/test/unit/git_cat_file_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitCatFileTest < Scm::Test
+ class GitCatFileTest < OhlohScm::Test
def test_cat_file
with_git_repository('git') do |git|
@@ -13,7 +13,7 @@ def test_cat_file
printf("Hello, World!\\n");
}
EXPECTED
- assert_equal expected, git.cat_file(nil, Scm::Diff.new(:sha1 => '4c734ad53b272c9b3d719f214372ac497ff6c068'))
+ assert_equal expected, git.cat_file(nil, OhlohScm::Diff.new(:sha1 => '4c734ad53b272c9b3d719f214372ac497ff6c068'))
end
end
diff --git a/test/unit/git_commit_all_test.rb b/test/unit/git_commit_all_test.rb
index cf1e766c..e9944eee 100644
--- a/test/unit/git_commit_all_test.rb
+++ b/test/unit/git_commit_all_test.rb
@@ -1,10 +1,10 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitCommitAllTest < Scm::Test
+ class GitCommitAllTest < OhlohScm::Test
def test_commit_all
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
git = GitAdapter.new(:url => dir).normalize
git.init_db
@@ -13,7 +13,7 @@ def test_commit_all
File.open(File.join(dir, 'README'), 'w') {}
assert git.anything_to_commit?
- c = Scm::Commit.new
+ c = OhlohScm::Commit.new
c.author_name = "John Q. Developer"
c.message = "Initial checkin."
git.commit_all(c)
diff --git a/test/unit/git_commits_test.rb b/test/unit/git_commits_test.rb
index 96008088..e12f0e22 100644
--- a/test/unit/git_commits_test.rb
+++ b/test/unit/git_commits_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitCommitsTest < Scm::Test
+ class GitCommitsTest < OhlohScm::Test
def test_commit_count
with_git_repository('git') do |git|
diff --git a/test/unit/git_head_test.rb b/test/unit/git_head_test.rb
index 93c5f44d..e193bd99 100644
--- a/test/unit/git_head_test.rb
+++ b/test/unit/git_head_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitHeadTest < Scm::Test
+ class GitHeadTest < OhlohScm::Test
def test_head_and_parents
with_git_repository('git') do |git|
diff --git a/test/unit/git_log_parser_test.rb b/test/unit/git_log_parser_test.rb
index 477e1724..f1f3554b 100644
--- a/test/unit/git_log_parser_test.rb
+++ b/test/unit/git_log_parser_test.rb
@@ -2,7 +2,7 @@
require 'date'
module OhlohScm::Parsers
- class GitStyledParserTest < Scm::Test
+ class GitStyledParserTest < OhlohScm::Test
def test_basic
commits = []
@@ -187,7 +187,7 @@ def test_use_email_when_names_are_missing
__BEGIN_COMMIT__
Commit: fa3ee9d4cefc2db81adadf36da9cacbe92ce96f1
-Author:
+Author:
AuthorEmail: mickeyl@openembedded.org
Date: Wed, 11 Jun 2008 00:37:06 +0000
__BEGIN_COMMENT__
diff --git a/test/unit/git_misc_test.rb b/test/unit/git_misc_test.rb
index 377949ab..9b74de35 100644
--- a/test/unit/git_misc_test.rb
+++ b/test/unit/git_misc_test.rb
@@ -1,11 +1,11 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitMiscTest < Scm::Test
+ class GitMiscTest < OhlohScm::Test
def test_export
with_git_repository('git') do |git|
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
git.export(dir)
assert_equal ['.','..','.gitignore','COPYING','README','helloworld.c','makefile','ohloh_token'], Dir.entries(dir).sort
end
@@ -27,8 +27,8 @@ def test_ls_tree
def test_is_merge_commit
with_git_repository('git_walk') do |git|
- assert git.is_merge_commit?(Scm::Commit.new(:token => 'f264fb40c340a415b305ac1f0b8f12502aa2788f'))
- assert !git.is_merge_commit?(Scm::Commit.new(:token => 'd067161caae2eeedbd74976aeff5c4d8f1ccc946'))
+ assert git.is_merge_commit?(OhlohScm::Commit.new(:token => 'f264fb40c340a415b305ac1f0b8f12502aa2788f'))
+ assert !git.is_merge_commit?(OhlohScm::Commit.new(:token => 'd067161caae2eeedbd74976aeff5c4d8f1ccc946'))
end
end
diff --git a/test/unit/git_parser_test.rb b/test/unit/git_parser_test.rb
index d37d04dc..5e029c69 100644
--- a/test/unit/git_parser_test.rb
+++ b/test/unit/git_parser_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class GitParserTest < Scm::Test
+ class GitParserTest < OhlohScm::Test
def test_empty_array
assert_equal([], GitParser.parse(''))
diff --git a/test/unit/git_patch_test.rb b/test/unit/git_patch_test.rb
index 65d0283c..bdcda499 100644
--- a/test/unit/git_patch_test.rb
+++ b/test/unit/git_patch_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitPatchTest < Scm::Test
+ class GitPatchTest < OhlohScm::Test
def test_patch_for_commit
with_git_repository('git') do |repo|
commit = repo.verbose_commit('b6e9220c3cabe53a4ed7f32952aeaeb8a822603d')
diff --git a/test/unit/git_pull_test.rb b/test/unit/git_pull_test.rb
index 780e7a1b..21d0bfea 100644
--- a/test/unit/git_pull_test.rb
+++ b/test/unit/git_pull_test.rb
@@ -1,11 +1,11 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitPullTest < Scm::Test
+ class GitPullTest < OhlohScm::Test
def test_basic_pull
with_git_repository('git') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = GitAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
diff --git a/test/unit/git_push_test.rb b/test/unit/git_push_test.rb
index 45d58ee6..973992c3 100644
--- a/test/unit/git_push_test.rb
+++ b/test/unit/git_push_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitPushTest < Scm::Test
+ class GitPushTest < OhlohScm::Test
def test_hostname
assert_equal "foo", GitAdapter.new(:url => 'foo:/bar').hostname
@@ -23,7 +23,7 @@ def test_local
def test_basic_push
with_git_repository('git') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = GitAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
@@ -34,7 +34,7 @@ def test_basic_push
# Now push again. This tests a different code path!
File.open(File.join(src.url, 'foo'), 'w') { }
- src.commit_all(Scm::Commit.new)
+ src.commit_all(OhlohScm::Commit.new)
src.push(dest)
assert dest.exist?
diff --git a/test/unit/git_rev_list_test.rb b/test/unit/git_rev_list_test.rb
index 8034026f..e4c6ed77 100644
--- a/test/unit/git_rev_list_test.rb
+++ b/test/unit/git_rev_list_test.rb
@@ -7,7 +7,7 @@ module OhlohScm::Adapters
# / \ \
# A -> B -> C -> D -> master
#
- class GitRevListTest < Scm::Test
+ class GitRevListTest < OhlohScm::Test
def test_rev_list
with_git_repository('git_walk') do |git|
diff --git a/test/unit/git_styled_parser_test.rb b/test/unit/git_styled_parser_test.rb
index 5d630dc1..afe9fdc6 100644
--- a/test/unit/git_styled_parser_test.rb
+++ b/test/unit/git_styled_parser_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class GitStyledParserTest < Scm::Test
+ class GitStyledParserTest < OhlohScm::Test
def test_empty_array
assert_equal([], GitStyledParser.parse(''))
@@ -13,13 +13,13 @@ def test_log_parser_nil_date
Commit: 1df547800dcd168e589bb9b26b4039bff3a7f7e4
Author: Jason Allen
AuthorEmail: jason@ohloh.net
-Date:
+Date:
__BEGIN_COMMENT__
moving COPYING
__END_COMMENT__
SAMPLE
-
+
commits = GitStyledParser.parse(sample_log)
assert_equal 1, commits.size
assert_equal Time.utc(1970,1,1,0,0,0), commits[0].author_date
@@ -37,7 +37,7 @@ def test_log_parser_bogus_date
__END_COMMENT__
SAMPLE
-
+
commits = GitStyledParser.parse(sample_log)
assert_equal 1, commits.size
assert_equal Time.utc(1970,1,1,0,0,0), commits[0].author_date
diff --git a/test/unit/git_token_test.rb b/test/unit/git_token_test.rb
index 6d5c41bf..5161a4cc 100644
--- a/test/unit/git_token_test.rb
+++ b/test/unit/git_token_test.rb
@@ -1,10 +1,10 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitTokenTest < Scm::Test
+ class GitTokenTest < OhlohScm::Test
def test_no_token_returns_nil
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
git = GitAdapter.new(:url => dir).normalize
assert !git.read_token
git.init_db
@@ -13,21 +13,21 @@ def test_no_token_returns_nil
end
def test_write_and_read_token
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
git = GitAdapter.new(:url => dir).normalize
git.init_db
git.write_token("FOO")
assert !git.read_token # Token not valid until committed
- git.commit_all(Scm::Commit.new)
+ git.commit_all(OhlohScm::Commit.new)
assert_equal "FOO", git.read_token
end
end
def test_commit_all_includes_write_token
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
git = GitAdapter.new(:url => dir).normalize
git.init_db
- c = Scm::Commit.new
+ c = OhlohScm::Commit.new
c.token = "BAR"
git.commit_all(c)
assert_equal c.token, git.read_token
diff --git a/test/unit/git_validation_test.rb b/test/unit/git_validation_test.rb
index 8b526f4f..b7492e8d 100644
--- a/test/unit/git_validation_test.rb
+++ b/test/unit/git_validation_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class GitValidationTest < Scm::Test
+ class GitValidationTest < OhlohScm::Test
def test_rejected_urls
[ nil, "", "foo", "http:/", "http:://", "http://", "http://a",
"kernel.org/linux/linux.git", # missing a protocol prefix
diff --git a/test/unit/hg_cat_file_test.rb b/test/unit/hg_cat_file_test.rb
index c85d6e82..efc374d6 100644
--- a/test/unit/hg_cat_file_test.rb
+++ b/test/unit/hg_cat_file_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HgCatFileTest < Scm::Test
+ class HgCatFileTest < OhlohScm::Test
def test_cat_file
with_hg_repository('hg') do |hg|
@@ -21,15 +21,15 @@ def test_cat_file
EXPECTED
# The file was deleted in revision 468336c6671c. Check that it does not exist now, but existed in parent.
- assert_equal nil, hg.cat_file(Scm::Commit.new(:token => '75532c1e1f1d'), Scm::Diff.new(:path => 'helloworld.c'))
- assert_equal expected, hg.cat_file_parent(Scm::Commit.new(:token => '75532c1e1f1d'), Scm::Diff.new(:path => 'helloworld.c'))
- assert_equal expected, hg.cat_file(Scm::Commit.new(:token => '468336c6671c'), Scm::Diff.new(:path => 'helloworld.c'))
+ assert_equal nil, hg.cat_file(OhlohScm::Commit.new(:token => '75532c1e1f1d'), OhlohScm::Diff.new(:path => 'helloworld.c'))
+ assert_equal expected, hg.cat_file_parent(OhlohScm::Commit.new(:token => '75532c1e1f1d'), OhlohScm::Diff.new(:path => 'helloworld.c'))
+ assert_equal expected, hg.cat_file(OhlohScm::Commit.new(:token => '468336c6671c'), OhlohScm::Diff.new(:path => 'helloworld.c'))
end
end
# Ensure that we escape bash-significant characters like ' and & when they appear in the filename
def test_funny_file_name_chars
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
# Make a file with a problematic filename
funny_name = '#|file_name` $(&\'")#'
File.open(File.join(dir, funny_name), 'w') { |f| f.write "contents" }
@@ -39,7 +39,7 @@ def test_funny_file_name_chars
# Confirm that we can read the file back
hg = HgAdapter.new(:url => dir).normalize
- assert_equal "contents", hg.cat_file(hg.head, Scm::Diff.new(:path => funny_name))
+ assert_equal "contents", hg.cat_file(hg.head, OhlohScm::Diff.new(:path => funny_name))
end
end
diff --git a/test/unit/hg_commits_test.rb b/test/unit/hg_commits_test.rb
index 86fdc4b3..bff9ad3c 100644
--- a/test/unit/hg_commits_test.rb
+++ b/test/unit/hg_commits_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HgCommitsTest < Scm::Test
+ class HgCommitsTest < OhlohScm::Test
def test_commit_count
with_hg_repository('hg') do |hg|
diff --git a/test/unit/hg_head_test.rb b/test/unit/hg_head_test.rb
index cefccbd6..915168ee 100644
--- a/test/unit/hg_head_test.rb
+++ b/test/unit/hg_head_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HgHeadTest < Scm::Test
+ class HgHeadTest < OhlohScm::Test
def test_head_and_parents
with_hg_repository('hg') do |hg|
diff --git a/test/unit/hg_misc_test.rb b/test/unit/hg_misc_test.rb
index 2916e403..53fccf1c 100644
--- a/test/unit/hg_misc_test.rb
+++ b/test/unit/hg_misc_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HgMiscTest < Scm::Test
+ class HgMiscTest < OhlohScm::Test
def test_exist
save_hg = nil
@@ -20,7 +20,7 @@ def test_ls_tree
def test_export
with_hg_repository('hg') do |hg|
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
hg.export(dir)
assert_equal ['.', '..', 'README', 'makefile'], Dir.entries(dir).sort
end
diff --git a/test/unit/hg_parser_test.rb b/test/unit/hg_parser_test.rb
index f7230ca9..93cdf8e9 100644
--- a/test/unit/hg_parser_test.rb
+++ b/test/unit/hg_parser_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class HgParserTest < Scm::Test
+ class HgParserTest < OhlohScm::Test
def test_empty_array
assert_equal([], HgParser.parse(''))
diff --git a/test/unit/hg_patch_test.rb b/test/unit/hg_patch_test.rb
index 95745390..8673244f 100644
--- a/test/unit/hg_patch_test.rb
+++ b/test/unit/hg_patch_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HgPatchTest < Scm::Test
+ class HgPatchTest < OhlohScm::Test
def test_patch_for_commit
with_hg_repository('hg') do |repo|
commit = repo.verbose_commit(1)
diff --git a/test/unit/hg_pull_test.rb b/test/unit/hg_pull_test.rb
index 475d8ff1..33bafdb2 100644
--- a/test/unit/hg_pull_test.rb
+++ b/test/unit/hg_pull_test.rb
@@ -1,11 +1,11 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HgPullTest < Scm::Test
+ class HgPullTest < OhlohScm::Test
def test_pull
with_hg_repository('hg') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = HgAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
diff --git a/test/unit/hg_push_test.rb b/test/unit/hg_push_test.rb
index f2e898b5..65069c84 100644
--- a/test/unit/hg_push_test.rb
+++ b/test/unit/hg_push_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HgPushTest < Scm::Test
+ class HgPushTest < OhlohScm::Test
def test_hostname
assert !HgAdapter.new.hostname
@@ -36,7 +36,7 @@ def test_hg_path
def test_push
with_hg_repository('hg') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = HgAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
diff --git a/test/unit/hg_rev_list_test.rb b/test/unit/hg_rev_list_test.rb
index 7d699131..6529a74b 100644
--- a/test/unit/hg_rev_list_test.rb
+++ b/test/unit/hg_rev_list_test.rb
@@ -7,7 +7,7 @@ module OhlohScm::Adapters
# / \ \
# A -> B -> C -> D -> tip
#
- class HgRevListTest < Scm::Test
+ class HgRevListTest < OhlohScm::Test
def test_rev_list
with_hg_repository('hg_walk') do |hg|
diff --git a/test/unit/hg_validation_test.rb b/test/unit/hg_validation_test.rb
index ea257179..517d5490 100644
--- a/test/unit/hg_validation_test.rb
+++ b/test/unit/hg_validation_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HgValidationTest < Scm::Test
+ class HgValidationTest < OhlohScm::Test
def test_rejected_urls
[ nil, "", "foo", "http:/", "http:://", "http://", "http://a",
"www.selenic.com/repo/hello", # missing a protool prefix
diff --git a/test/unit/hglib_cat_file_test.rb b/test/unit/hglib_cat_file_test.rb
index dcb194a5..19fa4f08 100644
--- a/test/unit/hglib_cat_file_test.rb
+++ b/test/unit/hglib_cat_file_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HglibCatFileTest < Scm::Test
+ class HglibCatFileTest < OhlohScm::Test
def test_cat_file
with_hglib_repository('hg') do |hg|
@@ -21,15 +21,15 @@ def test_cat_file
EXPECTED
# The file was deleted in revision 468336c6671c. Check that it does not exist now, but existed in parent.
- assert_equal nil, hg.cat_file(Scm::Commit.new(:token => '75532c1e1f1d'), Scm::Diff.new(:path => 'helloworld.c'))
- assert_equal expected, hg.cat_file_parent(Scm::Commit.new(:token => '75532c1e1f1d'), Scm::Diff.new(:path => 'helloworld.c'))
- assert_equal expected, hg.cat_file(Scm::Commit.new(:token => '468336c6671c'), Scm::Diff.new(:path => 'helloworld.c'))
+ assert_equal nil, hg.cat_file(OhlohScm::Commit.new(:token => '75532c1e1f1d'), OhlohScm::Diff.new(:path => 'helloworld.c'))
+ assert_equal expected, hg.cat_file_parent(OhlohScm::Commit.new(:token => '75532c1e1f1d'), OhlohScm::Diff.new(:path => 'helloworld.c'))
+ assert_equal expected, hg.cat_file(OhlohScm::Commit.new(:token => '468336c6671c'), OhlohScm::Diff.new(:path => 'helloworld.c'))
end
end
# Ensure that we escape bash-significant characters like ' and & when they appear in the filename
def test_funny_file_name_chars
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
# Make a file with a problematic filename
funny_name = '#|file_name` $(&\'")#'
File.open(File.join(dir, funny_name), 'w') { |f| f.write "contents" }
@@ -39,7 +39,7 @@ def test_funny_file_name_chars
# Confirm that we can read the file back
hg = HglibAdapter.new(:url => dir).normalize
- assert_equal "contents", hg.cat_file(hg.head, Scm::Diff.new(:path => funny_name))
+ assert_equal "contents", hg.cat_file(hg.head, OhlohScm::Diff.new(:path => funny_name))
end
end
diff --git a/test/unit/hglib_head_test.rb b/test/unit/hglib_head_test.rb
index e7c85541..12aea8a1 100644
--- a/test/unit/hglib_head_test.rb
+++ b/test/unit/hglib_head_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class HgHeadTest < Scm::Test
+ class HgHeadTest < OhlohScm::Test
def test_head_and_parents
with_hglib_repository('hg') do |hg|
diff --git a/test/unit/ohlog_command_line_test.rb b/test/unit/ohlog_command_line_test.rb
index 48fa9402..34f3724e 100644
--- a/test/unit/ohlog_command_line_test.rb
+++ b/test/unit/ohlog_command_line_test.rb
@@ -1,5 +1,5 @@
module OhlohScm::Parsers
- class CommandLineTest < Scm::Test
+ class CommandLineTest < OhlohScm::Test
def test_cvs_from_file
result = `#{File.dirname(__FILE__) + '/../../bin/ohlog'} --xml --cvs #{DATA_DIR + '/basic.rlog'}`
assert_equal 0, $?
diff --git a/test/unit/shellout_test.rb b/test/unit/shellout_test.rb
index dd8d4f27..c007d9a5 100644
--- a/test/unit/shellout_test.rb
+++ b/test/unit/shellout_test.rb
@@ -1,6 +1,6 @@
require_relative '../test_helper'
-class ShelloutTest < Scm::Test
+class ShelloutTest < OhlohScm::Test
def test_execute_must_pipe_the_results_accurately
status, out, err = Shellout.execute("ruby -e 'puts %[hello world]; STDERR.puts(%[some error])'")
diff --git a/test/unit/string_encoder_command_line_test.rb b/test/unit/string_encoder_command_line_test.rb
index 5db7538d..adecd81d 100644
--- a/test/unit/string_encoder_command_line_test.rb
+++ b/test/unit/string_encoder_command_line_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class StringEncoderCommandLineTest < Scm::Test
+ class StringEncoderCommandLineTest < OhlohScm::Test
def test_length_of_content_unchanged
file_path = File.expand_path('../../data/sample-content', __FILE__)
original_content_length = File.size(file_path)
diff --git a/test/unit/svn_cat_file_test.rb b/test/unit/svn_cat_file_test.rb
index f65c0ee6..b82cafc9 100644
--- a/test/unit/svn_cat_file_test.rb
+++ b/test/unit/svn_cat_file_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class SvnCatFileTest < Scm::Test
+ class SvnCatFileTest < OhlohScm::Test
def test_cat_file
with_svn_repository('svn') do |svn|
@@ -13,9 +13,9 @@ def test_cat_file
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 expected, svn.cat_file(OhlohScm::Commit.new(:token => 1), OhlohScm::Diff.new(:path => "trunk/helloworld.c"))
- assert_equal nil, svn.cat_file(Scm::Commit.new(:token => 1), Scm::Diff.new(:path => "file not found"))
+ assert_equal nil, svn.cat_file(OhlohScm::Commit.new(:token => 1), OhlohScm::Diff.new(:path => "file not found"))
end
end
end
diff --git a/test/unit/svn_chain_cat_file_test.rb b/test/unit/svn_chain_cat_file_test.rb
index 08e6139c..9dc1137e 100644
--- a/test/unit/svn_chain_cat_file_test.rb
+++ b/test/unit/svn_chain_cat_file_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class SvnChainCatFileTest < Scm::Test
+ class SvnChainCatFileTest < OhlohScm::Test
def test_cat_file_with_chaining
goodbye = <<-EXPECTED
@@ -13,11 +13,11 @@ def test_cat_file_with_chaining
EXPECTED
with_svn_chain_repository('svn_with_branching', '/trunk') do |svn|
# The first case asks for the file on the HEAD, so it should easily be found
- assert_equal goodbye, svn.cat_file(Scm::Commit.new(:token => 8), Scm::Diff.new(:path => "goodbyeworld.c"))
+ assert_equal goodbye, svn.cat_file(OhlohScm::Commit.new(:token => 8), OhlohScm::Diff.new(:path => "goodbyeworld.c"))
# The next test asks for the file as it appeared before /branches/development was moved to /trunk,
# so this request requires traversal up the chain to the parent SvnAdapter.
- assert_equal goodbye, svn.cat_file(Scm::Commit.new(:token => 5), Scm::Diff.new(:path => "goodbyeworld.c"))
+ assert_equal goodbye, svn.cat_file(OhlohScm::Commit.new(:token => 5), OhlohScm::Diff.new(:path => "goodbyeworld.c"))
end
end
end
diff --git a/test/unit/svn_chain_commits_test.rb b/test/unit/svn_chain_commits_test.rb
index 52e9d0c7..5a17f7eb 100644
--- a/test/unit/svn_chain_commits_test.rb
+++ b/test/unit/svn_chain_commits_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class SvnChainTest < Scm::Test
+ class SvnChainTest < OhlohScm::Test
def test_chained_commit_tokens
with_svn_chain_repository('svn_with_branching', '/trunk') do |svn|
diff --git a/test/unit/svn_chain_test.rb b/test/unit/svn_chain_test.rb
index d646e73a..bf15b627 100644
--- a/test/unit/svn_chain_test.rb
+++ b/test/unit/svn_chain_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class SvnChainTest < Scm::Test
+ class SvnChainTest < OhlohScm::Test
def test_chain
with_svn_chain_repository('svn_with_branching', '/trunk') do |svn|
@@ -54,7 +54,7 @@ def test_parent_svn
def test_parent_branch_name
svn = OhlohScm::Adapters::SvnChainAdapter.new(:branch_name => "/trunk")
- assert_equal "/branches/b", svn.parent_branch_name(Scm::Diff.new(:action => 'A',
+ assert_equal "/branches/b", svn.parent_branch_name(OhlohScm::Diff.new(:action => 'A',
:path => "/trunk", :from_revision => 1, :from_path => "/branches/b"))
end
diff --git a/test/unit/svn_commits_test.rb b/test/unit/svn_commits_test.rb
index 2deb521d..c6758594 100644
--- a/test/unit/svn_commits_test.rb
+++ b/test/unit/svn_commits_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class SvnCommitsTest < Scm::Test
+ class SvnCommitsTest < OhlohScm::Test
def test_commits
with_svn_repository('svn') do |svn|
@@ -32,8 +32,8 @@ def test_sha1
# Given a commit with diffs, fill in all of the SHA1 values.
def test_populate_sha1
with_svn_repository('svn') do |svn|
- c = Scm::Commit.new(:token => 3)
- c.diffs = [Scm::Diff.new(:path => "/trunk/helloworld.c", :action => "M")]
+ c = OhlohScm::Commit.new(:token => 3)
+ c.diffs = [OhlohScm::Diff.new(:path => "/trunk/helloworld.c", :action => "M")]
svn.populate_commit_sha1s!(c)
assert_equal 'f6adcae4447809b651c787c078d255b2b4e963c5', c.diffs.first.sha1
assert_equal '4c734ad53b272c9b3d719f214372ac497ff6c068', c.diffs.first.parent_sha1
@@ -42,7 +42,7 @@ def test_populate_sha1
def test_strip_commit_branch
svn = SvnAdapter.new(:branch_name => "/trunk")
- commit = Scm::Commit.new
+ commit = OhlohScm::Commit.new
# nil diffs before => nil diffs after
assert !svn.strip_commit_branch(commit).diffs
@@ -52,19 +52,19 @@ def test_strip_commit_branch
assert_equal [], svn.strip_commit_branch(commit).diffs
commit.diffs = [
- Scm::Diff.new(:path => "/trunk"),
- Scm::Diff.new(:path => "/trunk/helloworld.c"),
- Scm::Diff.new(:path => "/branches/a")
+ OhlohScm::Diff.new(:path => "/trunk"),
+ OhlohScm::Diff.new(:path => "/trunk/helloworld.c"),
+ OhlohScm::Diff.new(:path => "/branches/a")
]
assert_equal ['', '/helloworld.c'], svn.strip_commit_branch(commit).diffs.collect { |d| d.path }.sort
end
def test_strip_diff_branch
svn = SvnAdapter.new(:branch_name => "/trunk")
- assert !svn.strip_diff_branch(Scm::Diff.new)
- assert !svn.strip_diff_branch(Scm::Diff.new(:path => "/branches/b"))
- assert_equal '', svn.strip_diff_branch(Scm::Diff.new(:path => "/trunk")).path
- assert_equal '/helloworld.c', svn.strip_diff_branch(Scm::Diff.new(:path => "/trunk/helloworld.c")).path
+ assert !svn.strip_diff_branch(OhlohScm::Diff.new)
+ assert !svn.strip_diff_branch(OhlohScm::Diff.new(:path => "/branches/b"))
+ assert_equal '', svn.strip_diff_branch(OhlohScm::Diff.new(:path => "/trunk")).path
+ assert_equal '/helloworld.c', svn.strip_diff_branch(OhlohScm::Diff.new(:path => "/trunk/helloworld.c")).path
end
def test_strip_path_branch
@@ -88,8 +88,8 @@ def test_strip_path_branch_with_special_chars
def test_remove_dupes_add_modify
svn = SvnAdapter.new
- c = Scm::Commit.new(:diffs => [ Scm::Diff.new(:action => "A", :path => "foo"),
- Scm::Diff.new(:action => "M", :path => "foo") ])
+ c = OhlohScm::Commit.new(:diffs => [ OhlohScm::Diff.new(:action => "A", :path => "foo"),
+ OhlohScm::Diff.new(:action => "M", :path => "foo") ])
svn.remove_dupes(c)
assert_equal 1, c.diffs.size
@@ -98,8 +98,8 @@ def test_remove_dupes_add_modify
def test_remove_dupes_add_replace
svn = SvnAdapter.new
- c = Scm::Commit.new(:diffs => [ Scm::Diff.new(:action => "R", :path => "foo"),
- Scm::Diff.new(:action => "A", :path => "foo") ])
+ c = OhlohScm::Commit.new(:diffs => [ OhlohScm::Diff.new(:action => "R", :path => "foo"),
+ OhlohScm::Diff.new(:action => "A", :path => "foo") ])
svn.remove_dupes(c)
assert_equal 1, c.diffs.size
diff --git a/test/unit/svn_convert_test.rb b/test/unit/svn_convert_test.rb
index 08a3fca1..a8153d76 100644
--- a/test/unit/svn_convert_test.rb
+++ b/test/unit/svn_convert_test.rb
@@ -1,10 +1,10 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class SvnConvertTest < Scm::Test
+ class SvnConvertTest < OhlohScm::Test
def test_basic_convert
with_svn_repository('svn') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = GitAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
diff --git a/test/unit/svn_head_test.rb b/test/unit/svn_head_test.rb
index 30499ff3..2b94e782 100644
--- a/test/unit/svn_head_test.rb
+++ b/test/unit/svn_head_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class SvnHeadTest < Scm::Test
+ class SvnHeadTest < OhlohScm::Test
def test_head_and_parents
with_svn_repository('svn') do |svn|
diff --git a/test/unit/svn_misc_test.rb b/test/unit/svn_misc_test.rb
index 3f3cece8..0894f765 100644
--- a/test/unit/svn_misc_test.rb
+++ b/test/unit/svn_misc_test.rb
@@ -1,11 +1,11 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class SvnMiscTest < Scm::Test
+ class SvnMiscTest < OhlohScm::Test
def test_export
with_svn_repository('svn') do |svn|
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
svn.export(dir)
assert_equal ['.','..','branches','tags','trunk'], Dir.entries(dir).sort
end
diff --git a/test/unit/svn_parser_test.rb b/test/unit/svn_parser_test.rb
index c50cafa6..83609fa4 100644
--- a/test/unit/svn_parser_test.rb
+++ b/test/unit/svn_parser_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class SvnParserTest < Scm::Test
+ class SvnParserTest < OhlohScm::Test
def test_basic
assert_convert(SvnParser, DATA_DIR + '/simple.svn_log', DATA_DIR + '/simple.ohlog')
diff --git a/test/unit/svn_patch_test.rb b/test/unit/svn_patch_test.rb
index eda5b35e..301aea05 100644
--- a/test/unit/svn_patch_test.rb
+++ b/test/unit/svn_patch_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class SvnPatchTest < Scm::Test
+ class SvnPatchTest < OhlohScm::Test
def test_patch_for_commit
with_svn_repository('svn') do |repo|
commit = repo.verbose_commit(2)
diff --git a/test/unit/svn_pull_test.rb b/test/unit/svn_pull_test.rb
index 7341f21d..91985079 100644
--- a/test/unit/svn_pull_test.rb
+++ b/test/unit/svn_pull_test.rb
@@ -2,10 +2,10 @@
require 'socket'
module OhlohScm::Adapters
- class SvnPullTest < Scm::Test
+ class SvnPullTest < OhlohScm::Test
def test_svnadmin_create
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
url = File.join(dir, "my_svn_repo")
svn = SvnAdapter.new(:url => url).normalize
@@ -22,7 +22,7 @@ def test_svnadmin_create
def test_basic_pull_using_svnsync
with_svn_repository('svn') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = SvnAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
@@ -36,7 +36,7 @@ def test_basic_pull_using_svnsync
end
def test_svnadmin_create_local
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
svn = SvnAdapter.new(:url => "file://#{dir}")
svn.svnadmin_create_local
assert svn.exist?
@@ -47,7 +47,7 @@ def test_svnadmin_create_local
end
def test_svnadmin_create_remote
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
svn = SvnAdapter.new(:url => "svn+ssh://#{Socket.gethostname}#{dir}")
svn.svnadmin_create_remote
assert svn.exist?
diff --git a/test/unit/svn_push_test.rb b/test/unit/svn_push_test.rb
index fa59ec99..98594265 100644
--- a/test/unit/svn_push_test.rb
+++ b/test/unit/svn_push_test.rb
@@ -2,11 +2,11 @@
require 'socket'
module OhlohScm::Adapters
- class SvnPushTest < Scm::Test
+ class SvnPushTest < OhlohScm::Test
def test_basic_push_using_svnsync
with_svn_repository('svn') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = SvnAdapter.new(:url => dest_dir).normalize
assert !dest.exist?
@@ -23,7 +23,7 @@ def test_basic_push_using_svnsync
# Simulates pushing to another server in our cluster.
def test_ssh_push_using_svnsync
with_svn_repository('svn') do |src|
- Scm::ScratchDir.new do |dest_dir|
+ OhlohScm::ScratchDir.new do |dest_dir|
dest = SvnAdapter.new(:url => "svn+ssh://#{Socket.gethostname}#{File.expand_path(dest_dir)}").normalize
assert !dest.exist?
diff --git a/test/unit/svn_validation_test.rb b/test/unit/svn_validation_test.rb
index 274b8cfe..f8dc8cf2 100644
--- a/test/unit/svn_validation_test.rb
+++ b/test/unit/svn_validation_test.rb
@@ -1,13 +1,13 @@
require_relative '../test_helper'
module OhlohScm::Adapters
- class SvnValidationTest < Scm::Test
+ class SvnValidationTest < OhlohScm::Test
def test_valid_usernames
[nil,'','joe_36','a'*32,'robin@ohloh.net'].each do |username|
assert !SvnAdapter.new(:username => username).validate_username
end
end
-
+
def test_for_blank_svn_urls
svn = SvnAdapter.new(:url =>"")
assert_nil svn.path_to_file_url(svn.url)
@@ -167,7 +167,7 @@ def test_strip_trailing_whack_from_branch_name
end
def test_empty_branch_name_with_file_system
- Scm::ScratchDir.new do |dir|
+ OhlohScm::ScratchDir.new do |dir|
svn = SvnAdapter.new(:url => dir).normalize
assert_equal '', svn.branch_name
end
diff --git a/test/unit/svn_xml_parser_test.rb b/test/unit/svn_xml_parser_test.rb
index a2bd9f58..ccb9c066 100644
--- a/test/unit/svn_xml_parser_test.rb
+++ b/test/unit/svn_xml_parser_test.rb
@@ -1,7 +1,7 @@
require_relative '../test_helper'
module OhlohScm::Parsers
- class SvnXmlParserTest < Scm::Test
+ class SvnXmlParserTest < OhlohScm::Test
def test_basic
assert_convert(SvnXmlParser, DATA_DIR + '/simple.svn_xml_log', DATA_DIR + '/simple.ohlog')
@@ -14,7 +14,7 @@ def test_empty_array
def test_empty_xml
assert_equal("\n\n\n", SvnXmlParser.parse('', :writer => XmlWriter.new))
end
-
+
def test_copy_from
xml = <<-XML