Fix Windows assets and tests (#1425)
* Fix Windows assets and tests * Update gemojione
This commit is contained in:
+8
-8
@@ -40,15 +40,15 @@ def testpath(path)
|
||||
File.join(TEST_DIR, path)
|
||||
end
|
||||
|
||||
def cloned_testpath(path)
|
||||
def cloned_testpath(path, bare = false)
|
||||
repo = File.expand_path(testpath(path))
|
||||
path = File.dirname(repo)
|
||||
cloned = File.join(path, self.class.name)
|
||||
FileUtils.rm_rf(cloned)
|
||||
Dir.chdir(path) do
|
||||
%x{git clone #{File.basename(repo)} #{self.class.name} 2>/dev/null}
|
||||
end
|
||||
cloned
|
||||
tmp = Tempfile.new(self.class.name)
|
||||
path = tmp.path
|
||||
bare = bare ? "--bare" : ""
|
||||
tmp.close(true)
|
||||
redirect = Gem.win_platform? ? '' : '2>/dev/null'
|
||||
%x{git clone #{bare} #{repo} #{path} #{redirect}}
|
||||
path
|
||||
end
|
||||
|
||||
def commit_details
|
||||
|
||||
@@ -4,15 +4,13 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
||||
context "Precious::Views::Editing" do
|
||||
include Rack::Test::Methods
|
||||
setup do
|
||||
examples = testpath "examples"
|
||||
@path = File.join(examples, "test.git")
|
||||
@path = cloned_testpath('examples/revert.git')
|
||||
Precious::App.set(:gollum_path, @path)
|
||||
FileUtils.cp_r File.join(examples, "revert.git"), @path, :remove_destination => true
|
||||
@wiki = Gollum::Wiki.new(@path)
|
||||
end
|
||||
|
||||
teardown do
|
||||
FileUtils.rm_r(File.join(File.dirname(__FILE__), *%w[examples test.git]))
|
||||
FileUtils.rm_rf(@path)
|
||||
end
|
||||
|
||||
test "creating page is blocked" do
|
||||
|
||||
@@ -5,14 +5,12 @@ require File.expand_path '../../lib/gollum/views/page', __FILE__
|
||||
|
||||
context "Precious::Views::Page" do
|
||||
setup do
|
||||
examples = testpath "examples"
|
||||
@path = File.join(examples, "test.git")
|
||||
FileUtils.cp_r File.join(examples, "empty.git"), @path, :remove_destination => true
|
||||
@path = cloned_testpath('examples/empty.git')
|
||||
@wiki = Gollum::Wiki.new(@path)
|
||||
end
|
||||
|
||||
teardown do
|
||||
FileUtils.rm_r(File.join(File.dirname(__FILE__), *%w[examples test.git]))
|
||||
FileUtils.rm_rf(@path)
|
||||
end
|
||||
|
||||
test "h1 title sanitizes correctly" do
|
||||
|
||||
Reference in New Issue
Block a user