diff --git a/Rakefile b/Rakefile index f6ae1cd..767a100 100644 --- a/Rakefile +++ b/Rakefile @@ -13,19 +13,16 @@ def version_hash JSON.parse(File.new("src/version.json").read); end -def start_jasmine_server(jasmine_includes) +def start_jasmine_server(jasmine_includes = nil) require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder")) - includes = jasmine_includes + - ['/lib/json2.js', - '/lib/TrivialReporter.js'] - puts "your tests are here:" puts " http://localhost:8888/run.html" Jasmine::SimpleServer.start(8888, - lambda { includes + JasmineHelper.spec_file_urls }, - JasmineHelper.dir_mappings) + lambda { JasmineHelper.spec_file_urls }, + JasmineHelper.dir_mappings, + jasmine_includes) end namespace :jasmine do @@ -70,15 +67,14 @@ jasmine.version_= { desc "Run jasmine tests of source via server" task :server do - jasmine_includes = jasmine_sources + jasmine_includes = lambda { jasmine_sources + ['lib/TrivialReporter.js'] } start_jasmine_server(jasmine_includes) end desc "Build jasmine and run tests via server" task :server_build => 'jasmine:build' do - jasmine_includes = ['/lib/' + File.basename(Dir.glob("#{JasmineHelper.jasmine_lib_dir}/jasmine*.js").first)] - start_jasmine_server(jasmine_includes) + start_jasmine_server end namespace :test do @@ -95,23 +91,4 @@ jasmine.version_= { end -end - -desc "Run jasmine tests via server" -task :jasmine_server do - require File.expand_path(File.join(File.dirname(__FILE__), "contrib/ruby/jasmine_spec_builder")) - - includes = jasmine_sources + ['lib/TrivialReporter.js'] - spec_files = Dir.glob("spec/**/*.js") - - dir_mappings = { - "/spec" => "spec", - "/lib" => "lib", - "/src" => 'src' - } - - puts "your tests are here:" - puts " http://localhost:8888/run.html" - - Jasmine::SimpleServer.start(8888, includes + spec_files, dir_mappings) end \ No newline at end of file diff --git a/contrib/ruby/jasmine_runner.rb b/contrib/ruby/jasmine_runner.rb index bc77549..61ff5e0 100644 --- a/contrib/ruby/jasmine_runner.rb +++ b/contrib/ruby/jasmine_runner.rb @@ -61,20 +61,23 @@ module Jasmine end class RunAdapter - def initialize(spec_files_or_proc) + def initialize(spec_files_or_proc, jasmine_files = nil) @spec_files_or_proc = spec_files_or_proc + @jasmine_files = jasmine_files || [ + "/__JASMINE_ROOT__/lib/" + File.basename(Dir.glob("#{Jasmine.root}/lib/jasmine*.js").first), + "/__JASMINE_ROOT__/lib/TrivialReporter.js", + "/__JASMINE_ROOT__/lib/json2.js" + ] end def call(env) spec_files = @spec_files_or_proc spec_files = spec_files.call if spec_files.respond_to?(:call) + jasmine_files = @jasmine_files + jasmine_files = jasmine_files.call if jasmine_files.respond_to?(:call) + css_files = ["/__JASMINE_ROOT__/lib/jasmine.css"] - jasmine_files = [ - "/__JASMINE_ROOT__/lib/" + File.basename(Dir.glob("#{Jasmine.root}/lib/jasmine*.js").first), - "/__JASMINE_ROOT__/lib/TrivialReporter.js", - "/__JASMINE_ROOT__/lib/json2.js" - ] body = ERB.new(File.read(File.join(File.dirname(__FILE__), "run.html"))).result(binding) [ @@ -110,12 +113,12 @@ module Jasmine end class SimpleServer - def self.start(port, spec_files_or_proc, mappings) + def self.start(port, spec_files_or_proc, mappings, jasmine_files = nil) require 'thin' config = { - '/run.html' => Jasmine::Redirect.new('/'), - '/' => Jasmine::RunAdapter.new(spec_files_or_proc) + '/run.html' => Jasmine::Redirect.new('/'), + '/' => Jasmine::RunAdapter.new(spec_files_or_proc, jasmine_files) } mappings.each do |from, to| config[from] = Rack::File.new(to) @@ -124,8 +127,8 @@ module Jasmine config["/__JASMINE_ROOT__"] = Rack::File.new(Jasmine.root) app = Rack::Cascade.new([ - Rack::URLMap.new(config), - JsAlert.new + Rack::URLMap.new(config), + JsAlert.new ]) Thin::Server.start('0.0.0.0', port, app) @@ -170,16 +173,21 @@ module Jasmine def eval_js(script) escaped_script = "'" + script.gsub(/(['\\])/) { '\\' + $1 } + "'" - result = @driver.get_eval("window.eval(#{escaped_script})") + begin + result = @driver.get_eval("window.eval(#{escaped_script})") + rescue Selenium::CommandError + result = @driver.get_eval("eval(#{escaped_script}, window)") + end JSON.parse("[#{result}]")[0] end end class Runner - def initialize(selenium_jar_path, spec_files, dir_mappings) + def initialize(selenium_jar_path, spec_files, dir_mappings, jasmine_files = nil) @selenium_jar_path = selenium_jar_path @spec_files = spec_files @dir_mappings = dir_mappings + @jasmine_files = jasmine_files @selenium_pid = nil @jasmine_server_pid = nil @@ -208,7 +216,7 @@ module Jasmine @jasmine_server_pid = fork do Process.setpgrp - Jasmine::SimpleServer.start(@jasmine_server_port, @spec_files, @dir_mappings) + Jasmine::SimpleServer.start(@jasmine_server_port, @spec_files, @dir_mappings, @jasmine_files) exit! 0 end puts "jasmine server started. pid is #{@jasmine_server_pid}" diff --git a/doc/files.html b/doc/files.html index a6cf772..5d4b5dd 100644 --- a/doc/files.html +++ b/doc/files.html @@ -258,7 +258,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:58 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
\ No newline at end of file diff --git a/doc/index.html b/doc/index.html index f1d89e9..79b65b3 100644 --- a/doc/index.html +++ b/doc/index.html @@ -300,7 +300,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:58 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
\ No newline at end of file diff --git a/doc/symbols/_global_.html b/doc/symbols/_global_.html index c4e67c6..5eb02fd 100644 --- a/doc/symbols/_global_.html +++ b/doc/symbols/_global_.html @@ -908,7 +908,7 @@ A convenience method that allows existing specs to be disabled temporarily durin
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Block.html b/doc/symbols/jasmine.Block.html index 38555b7..4ab35b8 100644 --- a/doc/symbols/jasmine.Block.html +++ b/doc/symbols/jasmine.Block.html @@ -339,7 +339,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Env.html b/doc/symbols/jasmine.Env.html index 3328c57..114e039 100644 --- a/doc/symbols/jasmine.Env.html +++ b/doc/symbols/jasmine.Env.html @@ -384,7 +384,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.JsApiReporter.html b/doc/symbols/jasmine.JsApiReporter.html index 409d8ee..02a653a 100644 --- a/doc/symbols/jasmine.JsApiReporter.html +++ b/doc/symbols/jasmine.JsApiReporter.html @@ -316,7 +316,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.MultiReporter.html b/doc/symbols/jasmine.MultiReporter.html index 666923c..659a7e5 100644 --- a/doc/symbols/jasmine.MultiReporter.html +++ b/doc/symbols/jasmine.MultiReporter.html @@ -316,7 +316,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.NestedResults.html b/doc/symbols/jasmine.NestedResults.html index 27d073a..d0719e1 100644 --- a/doc/symbols/jasmine.NestedResults.html +++ b/doc/symbols/jasmine.NestedResults.html @@ -700,7 +700,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Reporter.html b/doc/symbols/jasmine.Reporter.html index fb7bfda..74f6508 100644 --- a/doc/symbols/jasmine.Reporter.html +++ b/doc/symbols/jasmine.Reporter.html @@ -316,7 +316,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Runner.html b/doc/symbols/jasmine.Runner.html index e73dfad..e70264a 100644 --- a/doc/symbols/jasmine.Runner.html +++ b/doc/symbols/jasmine.Runner.html @@ -384,7 +384,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Spec.html b/doc/symbols/jasmine.Spec.html index 73759b6..0f86075 100644 --- a/doc/symbols/jasmine.Spec.html +++ b/doc/symbols/jasmine.Spec.html @@ -339,7 +339,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Spy.html b/doc/symbols/jasmine.Spy.html index 5283d7d..69f0223 100644 --- a/doc/symbols/jasmine.Spy.html +++ b/doc/symbols/jasmine.Spy.html @@ -845,7 +845,7 @@ expect(foo.bar.callCount).toEqual(0);
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:58 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.Suite.html b/doc/symbols/jasmine.Suite.html index 08da603..ebbd170 100644 --- a/doc/symbols/jasmine.Suite.html +++ b/doc/symbols/jasmine.Suite.html @@ -402,7 +402,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:58 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.html b/doc/symbols/jasmine.html index 9e631bc..a1b66d8 100644 --- a/doc/symbols/jasmine.html +++ b/doc/symbols/jasmine.html @@ -678,7 +678,7 @@ Jasmine environment.
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:57 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/jasmine.util.html b/doc/symbols/jasmine.util.html index 164fef0..f17cc42 100644 --- a/doc/symbols/jasmine.util.html +++ b/doc/symbols/jasmine.util.html @@ -316,7 +316,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Fri Sep 04 2009 23:03:58 GMT-0700 (PDT) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed Sep 09 2009 18:14:14 GMT-0700 (PDT)
diff --git a/doc/symbols/src/lib_TrivialReporter.js.html b/doc/symbols/src/lib_TrivialReporter.js.html index 11b1124..b04a52d 100644 --- a/doc/symbols/src/lib_TrivialReporter.js.html +++ b/doc/symbols/src/lib_TrivialReporter.js.html @@ -37,92 +37,97 @@ 30 jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { 31 var suites = runner.suites(); 32 - 33 this.runnerDiv = this.createDom('div', { className: 'runner running' }, "Running..."); - 34 this.document.body.appendChild(this.runnerDiv); - 35 - 36 for (var i = 0; i < suites.length; i++) { - 37 var suite = suites[i]; - 38 var suiteDiv = this.createDom('div', { className: 'suite' }, - 39 this.createDom('a', { className: 'runSpec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), - 40 suite.description); - 41 this.suiteDivs[suite.getFullName()] = suiteDiv; - 42 var parentDiv = this.document.body; - 43 if (suite.parentSuite) { - 44 parentDiv = this.suiteDivs[suite.parentSuite.getFullName()]; - 45 } - 46 parentDiv.appendChild(suiteDiv); - 47 } - 48 }; - 49 - 50 jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { - 51 var results = runner.getResults(); - 52 var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; - 53 this.runnerDiv.setAttribute("class", className); - 54 var message = results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); - 55 this.runnerDiv.replaceChild(this.document.createTextNode(message), this.runnerDiv.firstChild); - 56 }; - 57 - 58 jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { - 59 var results = suite.getResults(); - 60 var status = results.passed() ? 'passed' : 'failed'; - 61 if (results.totalCount == 0) { // todo: change this to check results.skipped - 62 status = 'skipped'; - 63 } - 64 this.suiteDivs[suite.getFullName()].className += " " + status; - 65 }; - 66 - 67 jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { - 68 var results = spec.getResults(); - 69 var status = results.passed() ? 'passed' : 'failed'; - 70 if (results.skipped) { - 71 status = 'skipped'; - 72 } - 73 var specDiv = this.createDom('div', { className: 'spec ' + status }, - 74 this.createDom('a', { className: 'runSpec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), - 75 spec.getFullName()); - 76 - 77 - 78 var resultItems = results.getItems(); - 79 for (var i = 0; i < resultItems.length; i++) { - 80 var result = resultItems[i]; - 81 if (result.passed && !result.passed()) { - 82 var resultMessageDiv = this.createDom('div', {className: 'resultMessage fail'}); - 83 resultMessageDiv.innerHTML = result.message; // todo: lame; mend - 84 specDiv.appendChild(resultMessageDiv); - 85 specDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - 86 } - 87 } - 88 - 89 this.suiteDivs[spec.suite.getFullName()].appendChild(specDiv); - 90 }; - 91 - 92 jasmine.TrivialReporter.prototype.log = function() { - 93 console.log.apply(console, arguments); - 94 }; - 95 - 96 jasmine.TrivialReporter.prototype.getLocation = function() { - 97 return this.document.location; - 98 }; - 99 -100 jasmine.TrivialReporter.prototype.specFilter = function(spec) { -101 var paramMap = {}; -102 var params = this.getLocation().search.substring(1).split('&'); -103 for (var i = 0; i < params.length; i++) { -104 var p = params[i].split('='); -105 paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); -106 } -107 -108 if (!paramMap["spec"]) return true; -109 return spec.getFullName().indexOf(paramMap["spec"]) == 0; -110 }; -111 -112 //protect against console.log incidents -113 if (!("console" in window) || !("firebug" in console)) { -114 var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; -115 window.console = {}; -116 for (var i = 0, len = names.length; i < len; ++i) { -117 window.console[names[i]] = function() { -118 }; -119 } -120 } -121 \ No newline at end of file + 33 this.runnerDiv = this.createDom('div', { className: 'runner running' }, + 34 this.createDom('a', { className: 'runSpec', href: '?' }, "run all"), + 35 this.runnerMessageSpan = this.createDom('span', {}, "Running...")); + 36 this.document.body.appendChild(this.runnerDiv); + 37 + 38 for (var i = 0; i < suites.length; i++) { + 39 var suite = suites[i]; + 40 var suiteDiv = this.createDom('div', { className: 'suite' }, + 41 this.createDom('a', { className: 'runSpec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), + 42 suite.description); + 43 this.suiteDivs[suite.getFullName()] = suiteDiv; + 44 var parentDiv = this.document.body; + 45 if (suite.parentSuite) { + 46 parentDiv = this.suiteDivs[suite.parentSuite.getFullName()]; + 47 } + 48 parentDiv.appendChild(suiteDiv); + 49 } + 50 + 51 this.startedAt = new Date(); + 52 }; + 53 + 54 jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { + 55 var results = runner.getResults(); + 56 var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; + 57 this.runnerDiv.setAttribute("class", className); + 58 var message = results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); + 59 message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"; + 60 this.runnerMessageSpan.replaceChild(this.document.createTextNode(message), this.runnerMessageSpan.firstChild); + 61 }; + 62 + 63 jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { + 64 var results = suite.getResults(); + 65 var status = results.passed() ? 'passed' : 'failed'; + 66 if (results.totalCount == 0) { // todo: change this to check results.skipped + 67 status = 'skipped'; + 68 } + 69 this.suiteDivs[suite.getFullName()].className += " " + status; + 70 }; + 71 + 72 jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { + 73 var results = spec.getResults(); + 74 var status = results.passed() ? 'passed' : 'failed'; + 75 if (results.skipped) { + 76 status = 'skipped'; + 77 } + 78 var specDiv = this.createDom('div', { className: 'spec ' + status }, + 79 this.createDom('a', { className: 'runSpec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), + 80 spec.getFullName()); + 81 + 82 + 83 var resultItems = results.getItems(); + 84 for (var i = 0; i < resultItems.length; i++) { + 85 var result = resultItems[i]; + 86 if (result.passed && !result.passed()) { + 87 var resultMessageDiv = this.createDom('div', {className: 'resultMessage fail'}); + 88 resultMessageDiv.innerHTML = result.message; // todo: lame; mend + 89 specDiv.appendChild(resultMessageDiv); + 90 specDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); + 91 } + 92 } + 93 + 94 this.suiteDivs[spec.suite.getFullName()].appendChild(specDiv); + 95 }; + 96 + 97 jasmine.TrivialReporter.prototype.log = function() { + 98 console.log.apply(console, arguments); + 99 }; +100 +101 jasmine.TrivialReporter.prototype.getLocation = function() { +102 return this.document.location; +103 }; +104 +105 jasmine.TrivialReporter.prototype.specFilter = function(spec) { +106 var paramMap = {}; +107 var params = this.getLocation().search.substring(1).split('&'); +108 for (var i = 0; i < params.length; i++) { +109 var p = params[i].split('='); +110 paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); +111 } +112 +113 if (!paramMap["spec"]) return true; +114 return spec.getFullName().indexOf(paramMap["spec"]) == 0; +115 }; +116 +117 //protect against console.log incidents +118 if (!("console" in window) || !("firebug" in console)) { +119 var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; +120 window.console = {}; +121 for (var i = 0, len = names.length; i < len; ++i) { +122 window.console[names[i]] = function() { +123 }; +124 } +125 } +126 \ No newline at end of file diff --git a/doc/symbols/src/lib_jasmine-0.9.0.js.html b/doc/symbols/src/lib_jasmine-0.9.0.js.html index ef13aaa..bc1ee18 100644 --- a/doc/symbols/src/lib_jasmine-0.9.0.js.html +++ b/doc/symbols/src/lib_jasmine-0.9.0.js.html @@ -524,7 +524,7 @@ 517 "major": 0, 518 "minor": 9, 519 "build": 0, -520 "revision": 1252129945 +520 "revision": 1252545239 521 }; 522 /** 523 * @namespace diff --git a/examples/ruby/Rakefile b/examples/ruby/Rakefile index 55dbe9f..f1d9063 100644 --- a/examples/ruby/Rakefile +++ b/examples/ruby/Rakefile @@ -19,6 +19,6 @@ task :jasmine_server do puts " http://localhost:8888/run.html" Jasmine::SimpleServer.start(8888, - lambda { JasmineHelper.jasmine + JasmineHelper.spec_file_urls }, + lambda { JasmineHelper.spec_file_urls }, JasmineHelper.dir_mappings) end diff --git a/examples/ruby/spec/jasmine_spec.rb b/examples/ruby/spec/jasmine_spec.rb index 29f212a..872fc75 100644 --- a/examples/ruby/spec/jasmine_spec.rb +++ b/examples/ruby/spec/jasmine_spec.rb @@ -4,7 +4,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), "jasmine_helper.rb")) require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder")) jasmine_runner = Jasmine::Runner.new(SeleniumRC::Server.new.jar_path, - JasmineHelper.jasmine + JasmineHelper.spec_file_urls, + JasmineHelper.spec_file_urls, JasmineHelper.dir_mappings) spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.raw_spec_files, jasmine_runner) diff --git a/javascript.rake b/javascript.rake deleted file mode 100755 index 8d6a4e6..0000000 --- a/javascript.rake +++ /dev/null @@ -1,30 +0,0 @@ -namespace :spec do - desc "Run continuous integration tests" - require "spec" - require 'spec/rake/spectask' - - Spec::Rake::SpecTask.new(:javascript) do |t| - t.spec_opts = ["--color", "--format", "specdoc"] - t.spec_files = ["spec/javascript/jasmine_spec.rb"] - end - - - desc "Run specs via server" - task :jasmine_server do - require File.expand_path(File.join(RAILS_ROOT, "spec/javascript/jasmine_helper.rb")) - require File.expand_path(File.join(RAILS_ROOT, "spec/javascript/jasmine/contrib/ruby/jasmine_runner.rb")) - - - includes = ['lib/' + File.basename(Dir.glob("#{JasmineHelper.jasmine_lib_dir}/jasmine*.js").first), - 'lib/json2.js', - 'lib/TrivialReporter.js'] - - - puts "your tests are here:" - puts " http://localhost:8888/run.html" - - Jasmine::SimpleServer.start(8888, - lambda { includes + JasmineHelper.spec_file_urls }, - JasmineHelper.dir_mappings) - end -end diff --git a/lib/jasmine-0.9.0.js b/lib/jasmine-0.9.0.js index 8c62759..21ca905 100644 --- a/lib/jasmine-0.9.0.js +++ b/lib/jasmine-0.9.0.js @@ -517,7 +517,7 @@ jasmine.version_= { "major": 0, "minor": 9, "build": 0, - "revision": 1252130638 + "revision": 1252545255 }; /** * @namespace diff --git a/spec/jasmine_spec.rb b/spec/jasmine_spec.rb index 29f212a..872fc75 100644 --- a/spec/jasmine_spec.rb +++ b/spec/jasmine_spec.rb @@ -4,7 +4,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), "jasmine_helper.rb")) require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder")) jasmine_runner = Jasmine::Runner.new(SeleniumRC::Server.new.jar_path, - JasmineHelper.jasmine + JasmineHelper.spec_file_urls, + JasmineHelper.spec_file_urls, JasmineHelper.dir_mappings) spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.raw_spec_files, jasmine_runner)