Skip to content

Commit 2ea0d4f

Browse files
committed
OTWO-4267 Added dependencies configuration and resolved failing test cases
1 parent 6699a6d commit 2ea0d4f

File tree

7 files changed

+24
-15
lines changed

7 files changed

+24
-15
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
language: ruby
2+
before_install:
3+
- sudo apt-get install -y cvs
4+
- sudo ln -s /usr/bin/cvs /usr/bin/cvsnt
5+
- sudo apt-get install -y subversion
26
install:
37
- gem install posix-spawn
48
- sh .install_dependencies.sh

lib/ohloh_scm/adapters/bzr/misc.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ def exist?
1010
end
1111

1212
def ls_tree(token)
13-
run("cd #{path} && bzr ls -V -r #{to_rev_param(token)}").split("\n")
13+
run("cd #{path} && bzr ls -V -r #{to_rev_param(token)}").split("\n").map!{ |file_name|
14+
file_name.force_encoding(Encoding::UTF_8)
15+
}
1416
end
1517

1618
def to_rev_param(r=nil)

lib/ohloh_scm/adapters/hg/cat_file.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'shellwords'
2+
13
module OhlohScm::Adapters
24
class HgAdapter < AbstractAdapter
35
def cat_file(commit, diff)
@@ -20,7 +22,7 @@ def cat(revision, path)
2022
# Example:
2123
# "Foo Bar & Baz" => "Foo\ Bar\ \&\ Baz"
2224
def escape(path)
23-
path.gsub(/[ `'"&()<>|#\$]/) { |c| '\\' + c }
25+
path.shellescape
2426
end
2527
end
2628
end

test/unit/cvs_commits_test.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ class CvsCommitsTest < OhlohScm::Test
66
def test_commits
77
with_cvs_repository('cvs', 'simple') do |cvs|
88

9-
assert_equal ['2006/06/29 16:21:07',
10-
'2006/06/29 18:14:47',
11-
'2006/06/29 18:45:29',
12-
'2006/06/29 18:48:54',
13-
'2006/06/29 18:52:23'], cvs.commits.collect { |c| c.token }
14-
15-
assert_equal ['2006/06/29 18:48:54',
16-
'2006/06/29 18:52:23'],
17-
cvs.commits(:after => '2006/06/29 18:45:29').collect { |c| c.token }
9+
assert_equal ['2006-06-29 16:21:07',
10+
'2006-06-29 18:14:47',
11+
'2006-06-29 18:45:29',
12+
'2006-06-29 18:48:54',
13+
'2006-06-29 18:52:23'], cvs.commits.collect { |c| c.token }
1814

1915
# Make sure we are date format agnostic (2008/01/01 is the same as 2008-01-01)
20-
assert_equal ['2006/06/29 18:48:54',
21-
'2006/06/29 18:52:23'],
16+
assert_equal ['2006-06-29 18:48:54',
17+
'2006-06-29 18:52:23'],
18+
cvs.commits(:after => '2006/06/29 18:45:29').collect { |c| c.token }
19+
20+
assert_equal ['2006-06-29 18:48:54',
21+
'2006-06-29 18:52:23'],
2222
cvs.commits(:after => '2006-06-29 18:45:29').collect { |c| c.token }
2323

2424
assert_equal [], cvs.commits(:after => '2006/06/29 18:52:23').collect { |c| c.token }

test/unit/hg_cat_file_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_funny_file_name_chars
3535
File.open(File.join(dir, funny_name), 'w') { |f| f.write "contents" }
3636

3737
# Add it to an hg repository
38-
`cd #{dir} && hg init && hg add * && hg commit -m test`
38+
`cd #{dir} && hg init && hg add * && hg commit -u tester -m test`
3939

4040
# Confirm that we can read the file back
4141
hg = HgAdapter.new(:url => dir).normalize

test/unit/hglib_cat_file_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_funny_file_name_chars
3535
File.open(File.join(dir, funny_name), 'w') { |f| f.write "contents" }
3636

3737
# Add it to an hg repository
38-
`cd #{dir} && hg init && hg add * && hg commit -m test`
38+
`cd #{dir} && hg init && hg add * && hg commit -u tester -m test`
3939

4040
# Confirm that we can read the file back
4141
hg = HglibAdapter.new(:url => dir).normalize

test/unit/shellout_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require_relative '../test_helper'
2+
require 'timeout'
23

34
class ShelloutTest < OhlohScm::Test
45
def test_execute_must_pipe_the_results_accurately

0 commit comments

Comments
 (0)