[logaling-commit] logaling/logaling-server [prepare-archived-repository-for-spec] Prepare archived repository for spec

Back to archive index

SHIMADA Koji null+****@clear*****
Thu Nov 15 11:14:35 JST 2012


SHIMADA Koji	2012-11-15 11:14:35 +0900 (Thu, 15 Nov 2012)

  New Revision: f4a91adfb4974dd02d0a228ef90798711b67e5c0
  https://github.com/logaling/logaling-server/commit/f4a91adfb4974dd02d0a228ef90798711b67e5c0

  Log:
    Prepare archived repository for spec

  Added files:
    spec/data/test_repository_using_logaling.tar.gz
  Modified files:
    spec/models/github_project_spec.rb

  Added: spec/data/test_repository_using_logaling.tar.gz (+0 -0) 100644
===================================================================
(Binary files differ)

  Modified: spec/models/github_project_spec.rb (+13 -5)
===================================================================
--- spec/models/github_project_spec.rb    2012-11-05 15:51:41 +0900 (b70a183)
+++ spec/models/github_project_spec.rb    2012-11-15 11:14:35 +0900 (789fb2c)
@@ -1,12 +1,20 @@
 require 'spec_helper'
 
 describe GithubProject do
+  def archived_test_repository_path(repository_name)
+    File.join(File.expand_path(File.dirname(__FILE__)), "..", "data", "#{repository_name}.tar.gz")
+  end
+
+  def decompress_test_repository(repository_name)
+    dest_dir = Dir.mktmpdir
+    system "tar", "xfz", archived_test_repository_path(repository_name), "-C", dest_dir
+    File.join(dest_dir, repository_name)
+  end
+
   before do
-    # FIXME: Because fail 'git clone' on travis, so this line is commentted out.
-    #  see:
-    #  http://stackoverflow.com/questions/4770532/error-when-cloning-git-shallow-repository
-    #subject.stub!(:remote_repository_url)
-    #       .and_return(File.join(Rails.root, '.git'))
+    test_repository_path = decompress_test_repository("test_repository_using_logaling")
+    subject.stub!(:remote_repository_url)
+           .and_return(File.join(test_repository_path, '.git'))
   end
 
   describe 'using logaling' do
-------------- next part --------------
An HTML attachment was scrubbed...
Descargar 



More information about the logaling-commit mailing list
Back to archive index