Permalink
Browse files

Re-implemented all development Rake tasks in Thor. Now actually tested.

  • Loading branch information...
1 parent 4a1a212 commit 626da5a112c6075f663cad235cb8c4787ccfb859 Davis W. Frank committed Apr 1, 2012
View
2 .rspec
@@ -0,0 +1,2 @@
+--color
+--format Fuubar
View
@@ -10,22 +10,20 @@ end
task :default => :spec
-task :require_pages_submodule do
- raise "Submodule for Github Pages isn't present. Run git submodule update --init" unless pages_submodule_present
+desc "Run all developement tests"
+task :spec do
+ system "rspec"
end
-task :require_node do
- raise "\nNode.js is required to develop code for Jasmine. Please visit http://nodejs.org to install.\n\n" unless node_installed?
+# Keeping this around for the Doc task, remove when doc is refactored
+task :require_pages_submodule do
+ raise "Submodule for Github Pages isn't present. Run git submodule update --init" unless pages_submodule_present
end
def pages_submodule_present
File.exist?('pages/download.html')
end
-def node_installed?
- `which node` =~ /node/
-end
-
class String
include Term::ANSIColor
end
View
@@ -22,4 +22,9 @@ Gem::Specification.new do |s|
s.add_development_dependency "sass"
s.add_development_dependency "compass"
s.add_development_dependency "ragaskar-jsdoc_helper"
+ s.add_development_dependency "rspec"
+ s.add_development_dependency "fuubar"
+ s.add_development_dependency "awesome_print"
+ s.add_development_dependency "thor"
+ s.add_development_dependency "nokogiri"
end
View
@@ -0,0 +1 @@
+require "#{File.expand_path(File.dirname(__FILE__))}/tasks/jasmine_dev"
View
@@ -1,5 +1,5 @@
var fs = require("fs");
-var sys = require("sys");
+var util = require("util");
var path = require("path");
var JSHINT = require("./jshint").JSHINT;
@@ -84,7 +84,7 @@ jasmine.HtmlReporter = function(_doc) {
};
self.reportRunnerResults = function(runner) {
- reporterView.complete();
+ reporterView && reporterView.complete();
};
self.reportSuiteResults = function(suite) {
@@ -158,67 +158,7 @@ jasmine.HtmlReporter = function(_doc) {
);
}
};
-jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporterHelpers = {};
-
-jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
- var el = document.createElement(type);
-
- for (var i = 2; i < arguments.length; i++) {
- var child = arguments[i];
-
- if (typeof child === 'string') {
- el.appendChild(document.createTextNode(child));
- } else {
- if (child) {
- el.appendChild(child);
- }
- }
- }
-
- for (var attr in attrs) {
- if (attr == "className") {
- el[attr] = attrs[attr];
- } else {
- el.setAttribute(attr, attrs[attr]);
- }
- }
-
- return el;
-};
-
-jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
- var results = child.results();
- var status = results.passed() ? 'passed' : 'failed';
- if (results.skipped) {
- status = 'skipped';
- }
-
- return status;
-};
-
-jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
- var parentDiv = this.dom.summary;
- var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
- var parent = child[parentSuite];
-
- if (parent) {
- if (typeof this.views.suites[parent.id] == 'undefined') {
- this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
- }
- parentDiv = this.views.suites[parent.id].element;
- }
-
- parentDiv.appendChild(childElement);
-};
-
-
-jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
- for(var fn in jasmine.HtmlReporterHelpers) {
- ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
- }
-};
-
-jasmine.HtmlReporter.ReporterView = function(dom) {
+jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {
this.startedAt = new Date();
this.runningSpecCount = 0;
this.completeSpecCount = 0;
Oops, something went wrong.

0 comments on commit 626da5a

Please sign in to comment.