Skip to content

Commit

Permalink
added qunit
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkerlucio committed Sep 14, 2010
1 parent f74e74c commit 8f474b4
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions all.rb
Expand Up @@ -22,6 +22,7 @@
apply "#{@template_path}/jquery.rb"
apply "#{@template_path}/underscore.rb"
apply "#{@template_path}/jcheck.rb"
apply "#{@template_path}/qunit.rb"

# deploy
apply "#{@template_path}/capistrano.rb"
Expand Down
14 changes: 14 additions & 0 deletions qunit.rb
@@ -0,0 +1,14 @@
# download qunit files
get "http://github.com/jquery/qunit/raw/master/qunit/qunit.js", "public/javascripts/vendor/qunit.js"
get "http://github.com/jquery/qunit/raw/master/qunit/qunit.css", "public/stylesheets/vendor/qunit.css"

@delayed << lambda {
# generate controller for qunit
generate "controller qunit index"

# replace view
get "#{File.dirname(__FILE__)}/resources/qunit.html.erb", "app/views/qunit/index.html.erb", :force => true

# configure route
gsub_file "config/routes.rb", %{get "qunit/index"}, %{get "qunit" => "qunit#index" if Rails.env.development?}
}
9 changes: 9 additions & 0 deletions resources/assets.yml
Expand Up @@ -5,8 +5,17 @@ javascripts:
- public/javascripts/vendor/rails.js
- public/javascripts/vendor/jcheck.js
- public/javascripts/application.js

qunit:
- public/javascripts/vendor/jquery-1.4.2.js
- public/javascripts/vendor/underscore.js
- public/javascripts/vendor/qunit.js
- public/javascripts/test/**/*.js

stylesheets:
workspace:
- public/stylesheets/vendor/jcheck.css
- public/stylesheets/application.css

qunit:
- public/stylesheets/vendor/qunit.css
15 changes: 15 additions & 0 deletions resources/qunit.html.erb
@@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html>
<head>
<title>qUnit Tests</title>
<%= include_stylesheets :qunit %>
<%= include_javascripts :qunit %>
</head>
<body>
<h1 id="qunit-header">QUnit example</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">test markup, will be hidden</div>
</body>
</html>

0 comments on commit 8f474b4

Please sign in to comment.