-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test structure and submodule for testing
- Loading branch information
Showing
6 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "tests/example"] | ||
path = tests/example | ||
url = git://github.com/schacon/simplegit.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
task :default => :test | ||
|
||
desc "Run the tests." | ||
task :test do | ||
Dir.glob("tests/*_test.rb").each do |file| | ||
require file | ||
end | ||
end | ||
|
||
desc "Run test coverage." | ||
task :rcov do | ||
system "rcov tests/test.rb -i lib/git_http.rb -x rack -x Library -x tests" | ||
system "open coverage/index.html" | ||
end | ||
|
||
namespace :grack do | ||
desc "Start Grack" | ||
task :start do | ||
system "rackup config.ru -p 8080" | ||
end | ||
end | ||
|
||
desc "Start everything." | ||
multitask :start => [ 'grack:start' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule example
added at
ca82a6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require 'rubygems' | ||
require 'rack' | ||
require "rack/test" | ||
require 'test/unit' | ||
|
||
require 'lib/git_http' | ||
|
||
class GitHttpTest < Test::Unit::TestCase | ||
include Rack::Test::Methods | ||
|
||
def app | ||
GitHttp::App.new(false) | ||
end | ||
|
||
# def config_project_root | ||
# def config_git_path | ||
# def config_upload_path_on | ||
# def config_upload_path_off | ||
# def config_upload_path_setting_on | ||
# def config_upload_path_setting_off | ||
# def test_upload_pack_advertisement | ||
# def test_upload_pack_rpc | ||
# def test_receive_pack_advertisement | ||
# def test_receive_pack_rpc | ||
# def test_dumb_urls | ||
# def test_method_not_allowed | ||
# def test_not_a_command | ||
# def test_not_git_dir | ||
|
||
def test_redirect_logged_in_users_to_dashboard | ||
get "/" | ||
assert_equal "http://example.org/redirected", last_request.url | ||
assert last_response.ok? | ||
end | ||
|
||
end |