Skip to content

Commit a73fff9

Browse files
committed
use seed repo for testing to get same results on different machines
1 parent 4c70dbb commit a73fff9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pkg
22
.DS_Store
3+
repos/grit/

repos/grit.tar.gz

3.94 MB
Binary file not shown.

test/helper.rb

+11-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
require 'test/unit'
55
require 'mocha/setup'
66

7-
GRIT_REPO = ENV["GRIT_REPO"] || File.expand_path(File.join(File.dirname(__FILE__), '..'))
7+
8+
REPOS_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', 'repos'))
9+
GRIT_REPO = ENV["GRIT_REPO"] || File.join(REPOS_PATH, 'grit')
10+
11+
if File.exists?(GRIT_REPO)
12+
puts "Using repo from #{GRIT_REPO}"
13+
else
14+
puts 'Unpacking repo for tests...'
15+
puts `tar -C #{REPOS_PATH} -xvf #{GRIT_REPO}.tar.gz`
16+
end
817

918
include Grit
1019

@@ -13,7 +22,7 @@ def fixture(name)
1322
end
1423

1524
def absolute_project_path
16-
File.expand_path(File.join(File.dirname(__FILE__), '..'))
25+
GRIT_REPO
1726
end
1827

1928
def jruby?

0 commit comments

Comments
 (0)