diff --git a/Rakefile b/Rakefile index 0bf7255..0aa3c48 100644 --- a/Rakefile +++ b/Rakefile @@ -6,6 +6,10 @@ def jasmine_sources sources end +def jasmine_html_sources + ["src/html/TrivialReporter.js"] +end + def jasmine_filename "jasmine-#{jasmine_version}.js" end @@ -81,24 +85,28 @@ namespace :jasmine do old_jasmine_files = Dir.glob('lib/jasmine*.js') old_jasmine_files.each { |file| File.delete(file) } - jasmine = File.new("lib/jasmine.js", 'w') + File.open("lib/jasmine.js", 'w') do |jasmine| + sources.each do |source_filename| + jasmine.puts(File.read(source_filename)) + end - sources.each do |source_filename| - jasmine.puts(File.read(source_filename)) - end - - jasmine.puts %{ + jasmine.puts %{ jasmine.version_= { "major": #{version['major']}, "minor": #{version['minor']}, "build": #{version['build']}, "revision": #{Time.now.to_i} - }; +}; } + end - jasmine.close + File.open("lib/jasmine-html.js", 'w') do |jasmine_html| + jasmine_html_sources.each do |source_filename| + jasmine_html.puts(File.read(source_filename)) + end + end - FileUtils.cp("lib/jasmine.js", "lib/#{jasmine_filename version}") + FileUtils.cp("src/html/jasmine.css", "lib/jasmine.css") end desc "Build jasmine documentation" @@ -110,7 +118,7 @@ jasmine.version_= { JsdocHelper::Rake::Task.new(:lambda_jsdoc) do |t| - t[:files] = jasmine_sources << 'lib/TrivialReporter.js' + t[:files] = jasmine_sources << jasmine_html_sources t[:options] = "-a" end Rake::Task[:lambda_jsdoc].invoke @@ -131,12 +139,12 @@ jasmine.version_= { lib_dir = File.join(temp_dir, "lib/jasmine-#{jasmine_version}") FileUtils.mkdir_p(lib_dir) - [ - "jasmine.js", - "TrivialReporter.js", - "jasmine.css" - ].each do |f| - FileUtils.cp(File.join(root, 'lib', f), File.join(lib_dir, f)) + { + "lib/jasmine.js" => "jasmine.js", + "lib/jasmine-html.js" => "jasmine-html.js", + "src/html/jasmine.css" => "jasmine.css" + }.each_pair do |src, dest| + FileUtils.cp(File.join(root, src), File.join(lib_dir, dest)) end dist = File.join(root, 'dist') @@ -147,7 +155,7 @@ jasmine.version_= { task :server do - files = jasmine_sources + ['lib/TrivialReporter.js', 'lib/consolex.js'] + files = jasmine_sources + jasmine_html_sources jasmine_includes = lambda { raw_jasmine_includes = files.collect { |f| File.expand_path(File.join(JasmineHelper.jasmine_root, f)) } Jasmine.cachebust(raw_jasmine_includes).collect { |f| f.sub(JasmineHelper.jasmine_src_dir, "/src").sub(JasmineHelper.jasmine_lib_dir, "/lib") } diff --git a/example/SpecRunner.html b/example/SpecRunner.html index 3f7f0e5..54c36cc 100644 --- a/example/SpecRunner.html +++ b/example/SpecRunner.html @@ -5,7 +5,7 @@ Jasmine Test Runner - + diff --git a/lib/jasmine.js b/lib/jasmine.js index c6b65a0..c8c9dc7 100644 --- a/lib/jasmine.js +++ b/lib/jasmine.js @@ -929,6 +929,10 @@ jasmine.Reporter.prototype.reportRunnerResults = function(runner) { jasmine.Reporter.prototype.reportSuiteResults = function(suite) { }; +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSpecStarting = function(spec) { +}; + //noinspection JSUnusedLocalSymbols jasmine.Reporter.prototype.reportSpecResults = function(spec) { }; @@ -1410,7 +1414,14 @@ jasmine.MultiReporter.prototype.addReporter = function(reporter) { }; (function() { - var functionNames = ["reportRunnerStarting", "reportRunnerResults", "reportSuiteResults", "reportSpecResults", "log"]; + var functionNames = [ + "reportRunnerStarting", + "reportRunnerResults", + "reportSuiteResults", + "reportSpecStarting", + "reportSpecResults", + "log" + ]; for (var i = 0; i < functionNames.length; i++) { var functionName = functionNames[i]; jasmine.MultiReporter.prototype[functionName] = (function(functionName) { @@ -1934,7 +1945,8 @@ jasmine.Spec.prototype.execute = function(onComplete) { spec.finish(onComplete); return; } - this.env.reporter.log('>> Jasmine Running ' + this.suite.description + ' ' + this.description + '...'); + + this.env.reporter.reportSpecStarting(this); spec.env.currentSpec = spec; @@ -2327,5 +2339,5 @@ jasmine.version_= { "major": 0, "minor": 11, "build": 0, - "revision": 1277400646 - }; + "revision": 1277425679 +}; diff --git a/spec/runner.html b/spec/runner.html index 6ebd752..3a49a66 100644 --- a/spec/runner.html +++ b/spec/runner.html @@ -28,7 +28,7 @@ - + @@ -73,7 +73,7 @@ })(); - + diff --git a/lib/TrivialReporter.js b/src/html/TrivialReporter.js similarity index 100% rename from lib/TrivialReporter.js rename to src/html/TrivialReporter.js diff --git a/lib/jasmine.css b/src/html/jasmine.css similarity index 100% rename from lib/jasmine.css rename to src/html/jasmine.css