Ruby runner changes. Users of previous versions with Rake tasks that make use of additional runner options (helpers, etc) may be broken.

This commit is contained in:
ragaskar 2009-10-31 21:47:11 -07:00
commit 8feb285ca8
29 changed files with 2153 additions and 1498 deletions

View File

@ -19,10 +19,11 @@ def start_jasmine_server(jasmine_includes = nil)
puts "your tests are here:" puts "your tests are here:"
puts " http://localhost:8888/run.html" puts " http://localhost:8888/run.html"
Jasmine::SimpleServer.start(8888, Jasmine::SimpleServer.start(
lambda { JasmineHelper.spec_file_urls }, 8888,
JasmineHelper.dir_mappings, lambda { JasmineHelper.specs },
jasmine_includes) JasmineHelper.dir_mappings,
:jasmine_files => jasmine_includes)
end end
namespace :jasmine do namespace :jasmine do
@ -67,7 +68,11 @@ jasmine.version_= {
desc "Run jasmine tests of source via server" desc "Run jasmine tests of source via server"
task :server do task :server do
jasmine_includes = lambda { jasmine_sources + ['lib/TrivialReporter.js', 'lib/consolex.js'] } files = jasmine_sources + ['lib/TrivialReporter.js', 'lib/consolex.js']
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") }
}
start_jasmine_server(jasmine_includes) start_jasmine_server(jasmine_includes)
end end

View File

@ -49,6 +49,7 @@ module Jasmine
end end
def self.cachebust(files, root_dir="", replace=nil, replace_with=nil) def self.cachebust(files, root_dir="", replace=nil, replace_with=nil)
require 'digest/md5'
files.collect do |file_name| files.collect do |file_name|
real_file_name = replace && replace_with ? file_name.sub(replace, replace_with) : file_name real_file_name = replace && replace_with ? file_name.sub(replace, replace_with) : file_name
begin begin
@ -61,26 +62,33 @@ module Jasmine
end end
class RunAdapter class RunAdapter
def initialize(spec_files_or_proc, jasmine_files = nil, stylesheets = []) def initialize(spec_files_or_proc, options = {})
@spec_files_or_proc = spec_files_or_proc @spec_files_or_proc = Jasmine.files(spec_files_or_proc) || []
@jasmine_files = jasmine_files || [ @jasmine_files = Jasmine.files(options[:jasmine_files]) || [
"/__JASMINE_ROOT__/lib/" + File.basename(Dir.glob("#{Jasmine.root}/lib/jasmine*.js").first), "/__JASMINE_ROOT__/lib/" + File.basename(Dir.glob("#{Jasmine.root}/lib/jasmine*.js").first),
"/__JASMINE_ROOT__/lib/TrivialReporter.js", "/__JASMINE_ROOT__/lib/TrivialReporter.js",
"/__JASMINE_ROOT__/lib/json2.js", "/__JASMINE_ROOT__/lib/json2.js",
"/__JASMINE_ROOT__/lib/consolex.js", "/__JASMINE_ROOT__/lib/consolex.js",
] ]
@stylesheets = ["/__JASMINE_ROOT__/lib/jasmine.css"] + stylesheets @stylesheets = ["/__JASMINE_ROOT__/lib/jasmine.css"] + (Jasmine.files(options[:stylesheets]) || [])
@spec_helpers = Jasmine.files(options[:spec_helpers]) || []
end end
def call(env) def call(env)
run
end
def run
stylesheets = @stylesheets
spec_helpers = @spec_helpers
spec_files = @spec_files_or_proc 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
jasmine_files = jasmine_files.call if jasmine_files.respond_to?(:call) jasmine_files = jasmine_files.call if jasmine_files.respond_to?(:call)
css_files = @stylesheets css_files = @stylesheets
body = ERB.new(File.read(File.join(File.dirname(__FILE__), "run.html"))).result(binding) body = ERB.new(File.read(File.join(File.dirname(__FILE__), "run.html"))).result(binding)
[ [
200, 200,
@ -88,6 +96,8 @@ module Jasmine
body body
] ]
end end
end end
class Redirect class Redirect
@ -114,13 +124,36 @@ module Jasmine
end end
end end
class SimpleServer class FocusedSuite
def self.start(port, spec_files_or_proc, mappings, jasmine_files = nil, stylesheets = []) def initialize(spec_files_or_proc, options)
require 'thin' @spec_files_or_proc = Jasmine.files(spec_files_or_proc) || []
@options = options
end
def call(env)
spec_files = @spec_files_or_proc
matching_specs = spec_files.select {|spec_file| spec_file =~ /#{Regexp.escape(env["PATH_INFO"])}/ }.compact
if !matching_specs.empty?
run_adapter = Jasmine::RunAdapter.new(matching_specs, @options)
run_adapter.run
else
[
200,
{ 'Content-Type' => 'application/javascript' },
"document.write('<p>Couldn\\'t find any specs matching #{env["PATH_INFO"]}!</p>');"
]
end
end
end
class SimpleServer
def self.start(port, spec_files_or_proc, mappings, options = {})
require 'thin'
config = { config = {
'/__suite__' => Jasmine::FocusedSuite.new(spec_files_or_proc, options),
'/run.html' => Jasmine::Redirect.new('/'), '/run.html' => Jasmine::Redirect.new('/'),
'/' => Jasmine::RunAdapter.new(spec_files_or_proc, jasmine_files, stylesheets) '/' => Jasmine::RunAdapter.new(spec_files_or_proc, options)
} }
mappings.each do |from, to| mappings.each do |from, to|
config[from] = Rack::File.new(to) config[from] = Rack::File.new(to)
@ -186,15 +219,13 @@ module Jasmine
end end
class Runner class Runner
def initialize(selenium_jar_path, spec_files, dir_mappings, jasmine_files = nil, options={}) def initialize(selenium_jar_path, spec_files, dir_mappings, options={})
@selenium_jar_path = selenium_jar_path @selenium_jar_path = selenium_jar_path
@spec_files = spec_files @spec_files = spec_files
@dir_mappings = dir_mappings @dir_mappings = dir_mappings
@jasmine_files = jasmine_files @options = options
@browser = options[:browser] || 'firefox'
@stylesheets = options[:stylesheets] || []
@browser = options[:browser] ? options[:browser].delete(:browser) : 'firefox'
@selenium_pid = nil @selenium_pid = nil
@jasmine_server_pid = nil @jasmine_server_pid = nil
end end
@ -222,7 +253,7 @@ module Jasmine
@jasmine_server_pid = fork do @jasmine_server_pid = fork do
Process.setpgrp Process.setpgrp
Jasmine::SimpleServer.start(@jasmine_server_port, @spec_files, @dir_mappings, @jasmine_files, @stylesheets) Jasmine::SimpleServer.start(@jasmine_server_port, @spec_files, @dir_mappings, @options)
exit! 0 exit! 0
end end
puts "jasmine server started. pid is #{@jasmine_server_pid}" puts "jasmine server started. pid is #{@jasmine_server_pid}"
@ -252,4 +283,11 @@ module Jasmine
@client.eval_js(script) @client.eval_js(script)
end end
end end
def self.files(f)
result = f
result = result.call if result.respond_to?(:call)
result
end
end end

View File

@ -11,6 +11,10 @@
<script src="<%= jasmine_file %>" type="text/javascript"></script> <script src="<%= jasmine_file %>" type="text/javascript"></script>
<% end %> <% end %>
<% spec_helpers.each do |spec_helper| %>
<script src="<%= spec_helper %>" type="text/javascript"></script>
<% end %>
<script type="text/javascript"> <script type="text/javascript">
var jsApiReporter; var jsApiReporter;
(function() { (function() {

View File

@ -272,7 +272,7 @@ ul.inheritsList
</div> </div>
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:39 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -308,7 +308,7 @@ ul.inheritsList
</div> </div>
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:39 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -910,7 +910,7 @@ A convenience method that allows existing specs to be disabled temporarily durin
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:38 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -341,7 +341,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:38 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -509,7 +509,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:38 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -318,7 +318,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:38 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -266,6 +266,184 @@ ul.inheritsList
<!-- ============================== properties summary ===================== --> <!-- ============================== properties summary ===================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class jasmine.Matchers.">
<caption>Field Summary</caption>
<thead>
<tr>
<th scope="col">Field Attributes</th>
<th scope="col">Field Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toBe">toBe</a></b>
</div>
<div class="description">toBe: compares the actual to the expected using ===</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toBeDefined">toBeDefined</a></b>
</div>
<div class="description">Matcher that compares the acutal to undefined.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toBeFalsy">toBeFalsy</a></b>
</div>
<div class="description">Matcher that boolean nots the actual.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toBeNull">toBeNull</a></b>
</div>
<div class="description">Matcher that compares the actual to null.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toBeTruthy">toBeTruthy</a></b>
</div>
<div class="description">Matcher that boolean not-nots the actual.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toBeUndefined">toBeUndefined</a></b>
</div>
<div class="description">Matcher that compares the acutal to undefined.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toContain">toContain</a></b>
</div>
<div class="description">Matcher that checks that the expected item is an element in the actual Array.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toEqual">toEqual</a></b>
</div>
<div class="description">toEqual: compares the actual to the expected using common sense equality.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toMatch">toMatch</a></b>
</div>
<div class="description">Matcher that compares the actual to the expected using a regular expression.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toNotBe">toNotBe</a></b>
</div>
<div class="description">toNotBe: compares the actual to the expected using !==</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toNotContain">toNotContain</a></b>
</div>
<div class="description">Matcher that checks that the expected item is NOT an element in the actual Array.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toNotEqual">toNotEqual</a></b>
</div>
<div class="description">toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toNotMatch">toNotMatch</a></b>
</div>
<div class="description">Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#toThrow">toThrow</a></b>
</div>
<div class="description">Matcher that checks that the expected exception was thrown by the actual.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#wasCalled">wasCalled</a></b>
</div>
<div class="description">Matcher that checks to see if the acutal, a Jasmine spy, was called.</div>
</td>
</tr>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">
<b><a href="../symbols/jasmine.Matchers.html#wasNotCalled">wasNotCalled</a></b>
</div>
<div class="description">Matcher that checks to see if the acutal, a Jasmine spy, was not called.</div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== methods summary ======================== --> <!-- ============================== methods summary ======================== -->
@ -327,6 +505,364 @@ ul.inheritsList
<!-- ============================== field details ========================== --> <!-- ============================== field details ========================== -->
<div class="sectionTitle">
Field Detail
</div>
<a name="toBe"> </a>
<div class="fixedFont">
<b>toBe</b>
</div>
<div class="description">
toBe: compares the actual to the expected using ===
</div>
<hr />
<a name="toBeDefined"> </a>
<div class="fixedFont">
<b>toBeDefined</b>
</div>
<div class="description">
Matcher that compares the acutal to undefined.
</div>
<hr />
<a name="toBeFalsy"> </a>
<div class="fixedFont">
<b>toBeFalsy</b>
</div>
<div class="description">
Matcher that boolean nots the actual.
</div>
<hr />
<a name="toBeNull"> </a>
<div class="fixedFont">
<b>toBeNull</b>
</div>
<div class="description">
Matcher that compares the actual to null.
</div>
<hr />
<a name="toBeTruthy"> </a>
<div class="fixedFont">
<b>toBeTruthy</b>
</div>
<div class="description">
Matcher that boolean not-nots the actual.
</div>
<hr />
<a name="toBeUndefined"> </a>
<div class="fixedFont">
<b>toBeUndefined</b>
</div>
<div class="description">
Matcher that compares the acutal to undefined.
</div>
<hr />
<a name="toContain"> </a>
<div class="fixedFont">
<b>toContain</b>
</div>
<div class="description">
Matcher that checks that the expected item is an element in the actual Array.
</div>
<hr />
<a name="toEqual"> </a>
<div class="fixedFont">
<b>toEqual</b>
</div>
<div class="description">
toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
</div>
<hr />
<a name="toMatch"> </a>
<div class="fixedFont">
<b>toMatch</b>
</div>
<div class="description">
Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes
a pattern or a String.
</div>
<hr />
<a name="toNotBe"> </a>
<div class="fixedFont">
<b>toNotBe</b>
</div>
<div class="description">
toNotBe: compares the actual to the expected using !==
</div>
<hr />
<a name="toNotContain"> </a>
<div class="fixedFont">
<b>toNotContain</b>
</div>
<div class="description">
Matcher that checks that the expected item is NOT an element in the actual Array.
</div>
<hr />
<a name="toNotEqual"> </a>
<div class="fixedFont">
<b>toNotEqual</b>
</div>
<div class="description">
toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual
</div>
<hr />
<a name="toNotMatch"> </a>
<div class="fixedFont">
<b>toNotMatch</b>
</div>
<div class="description">
Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
</div>
<hr />
<a name="toThrow"> </a>
<div class="fixedFont">
<b>toThrow</b>
</div>
<div class="description">
Matcher that checks that the expected exception was thrown by the actual.
</div>
<hr />
<a name="wasCalled"> </a>
<div class="fixedFont">
<b>wasCalled</b>
</div>
<div class="description">
Matcher that checks to see if the acutal, a Jasmine spy, was called.
</div>
<hr />
<a name="wasNotCalled"> </a>
<div class="fixedFont">
<b>wasNotCalled</b>
</div>
<div class="description">
Matcher that checks to see if the acutal, a Jasmine spy, was not called.
</div>
<!-- ============================== method details ========================= --> <!-- ============================== method details ========================= -->
@ -341,7 +877,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:38 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -318,7 +318,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:38 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -702,7 +702,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:38 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -318,7 +318,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:38 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -329,7 +329,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:39 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -269,6 +269,33 @@ ul.inheritsList
<!-- ============================== methods summary ======================== --> <!-- ============================== methods summary ======================== -->
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Spec.">
<caption>Method Summary</caption>
<thead>
<tr>
<th scope="col">Method Attributes</th>
<th scope="col">Method Name and Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="attributes">&nbsp;</td>
<td class="nameDescription">
<div class="fixedFont"><b><a href="../symbols/jasmine.Spec.html#getResults">getResults</a></b>()
</div>
<div class="description"></div>
</td>
</tr>
</tbody>
</table>
<!-- ============================== events summary ======================== --> <!-- ============================== events summary ======================== -->
@ -330,6 +357,36 @@ ul.inheritsList
<!-- ============================== method details ========================= --> <!-- ============================== method details ========================= -->
<div class="sectionTitle">
Method Detail
</div>
<a name="getResults"> </a>
<div class="fixedFont">
<b>getResults</b>()
</div>
<div class="description">
</div>
<!-- ============================== event details ========================= --> <!-- ============================== event details ========================= -->
@ -341,7 +398,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:39 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -847,7 +847,7 @@ expect(foo.bar.callCount).toEqual(0);</pre>
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:39 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -347,7 +347,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:39 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -762,7 +762,7 @@ Jasmine environment.
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:38 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -318,7 +318,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Fri Oct 30 2009 19:27:04 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 31 2009 21:44:39 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,6 @@ task :jasmine_server do
puts " http://localhost:8888/run.html" puts " http://localhost:8888/run.html"
Jasmine::SimpleServer.start(8888, Jasmine::SimpleServer.start(8888,
lambda { JasmineHelper.spec_file_urls }, lambda { JasmineHelper.specs },
JasmineHelper.dir_mappings) JasmineHelper.dir_mappings)
end end

View File

@ -27,7 +27,7 @@ class JasmineHelper
Dir.glob(File.join(jasmine_spec_dir, "**/*[Ss]pec.js")) Dir.glob(File.join(jasmine_spec_dir, "**/*[Ss]pec.js"))
end end
def self.spec_file_urls def self.specs
raw_spec_files.collect {|f| f.sub(jasmine_spec_dir, "/spec")} raw_spec_files.collect {|f| f.sub(jasmine_spec_dir, "/spec")}
end end

View File

@ -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")) require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
jasmine_runner = Jasmine::Runner.new(SeleniumRC::Server.new.jar_path, jasmine_runner = Jasmine::Runner.new(SeleniumRC::Server.new.jar_path,
JasmineHelper.spec_file_urls, JasmineHelper.specs,
JasmineHelper.dir_mappings) JasmineHelper.dir_mappings)
spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.raw_spec_files, jasmine_runner) spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.raw_spec_files, jasmine_runner)

View File

@ -28,16 +28,14 @@ jasmine.UPDATE_INTERVAL = 250;
*/ */
jasmine.bindOriginal_ = function(base, name) { jasmine.bindOriginal_ = function(base, name) {
var original = base[name]; var original = base[name];
return function() { if (original.apply) {
if (original.apply) { return function() {
return original.apply(base, arguments); return original.apply(base, arguments);
} else { };
//IE support } else {
if (base == window) { // IE support
return window[name].apply(window, arguments); return window[name];
} }
}
};
}; };
jasmine.setTimeout = jasmine.bindOriginal_(window, 'setTimeout'); jasmine.setTimeout = jasmine.bindOriginal_(window, 'setTimeout');
@ -536,7 +534,7 @@ jasmine.version_= {
"major": 0, "major": 0,
"minor": 10, "minor": 10,
"build": 0, "build": 0,
"revision": 1256956024 "revision": 1257050679
}; };
/** /**
* @namespace * @namespace
@ -1836,6 +1834,11 @@ jasmine.Spec.prototype.log = function(message) {
return this.results_.log(message); return this.results_.log(message);
}; };
/** @deprecated */
jasmine.Spec.prototype.getResults = function() {
return this.results_;
};
jasmine.Spec.prototype.runs = function (func) { jasmine.Spec.prototype.runs = function (func) {
var block = new jasmine.Block(this.env, func, this); var block = new jasmine.Block(this.env, func, this);
this.addToQueue(block); this.addToQueue(block);

View File

@ -6,10 +6,10 @@ class JasmineHelper
def self.jasmine def self.jasmine
['/lib/' + File.basename(Dir.glob("#{JasmineHelper.jasmine_lib_dir}/jasmine*.js").first)] + ['/lib/' + File.basename(Dir.glob("#{JasmineHelper.jasmine_lib_dir}/jasmine*.js").first)] +
['/lib/json2.js', ['/lib/json2.js',
'/lib/TrivialReporter.js'] '/lib/TrivialReporter.js']
end end
def self.jasmine_root def self.jasmine_root
File.expand_path(File.join(File.dirname(__FILE__), '..')) File.expand_path(File.join(File.dirname(__FILE__), '..'))
end end
@ -18,6 +18,10 @@ def self.jasmine_root
File.expand_path(File.join(jasmine_root, 'src')) File.expand_path(File.join(jasmine_root, 'src'))
end end
def self.jasmine_lib_dir
File.expand_path(File.join(jasmine_root, 'lib'))
end
def self.jasmine_spec_dir def self.jasmine_spec_dir
File.expand_path(File.join(jasmine_root, 'spec')) File.expand_path(File.join(jasmine_root, 'spec'))
end end
@ -26,15 +30,15 @@ def self.jasmine_root
Dir.glob(File.join(jasmine_spec_dir, "**/*[Ss]pec.js")) Dir.glob(File.join(jasmine_spec_dir, "**/*[Ss]pec.js"))
end end
def self.spec_file_urls def self.specs
raw_spec_files.collect {|f| f.sub(jasmine_spec_dir, "/spec")} Jasmine.cachebust(raw_spec_files).collect {|f| f.sub(jasmine_spec_dir, "/spec")}
end end
def self.dir_mappings def self.dir_mappings
{ {
"/src" => jasmine_src_dir, "/src" => jasmine_src_dir,
"/spec" => jasmine_spec_dir, "/spec" => jasmine_spec_dir,
"/lib" => jasmine_lib_dir "/lib" => jasmine_lib_dir
} }
end end
end end

View File

@ -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")) require File.expand_path(File.join(JasmineHelper.jasmine_root, "contrib/ruby/jasmine_spec_builder"))
jasmine_runner = Jasmine::Runner.new(SeleniumRC::Server.new.jar_path, jasmine_runner = Jasmine::Runner.new(SeleniumRC::Server.new.jar_path,
JasmineHelper.spec_file_urls, JasmineHelper.specs,
JasmineHelper.dir_mappings) JasmineHelper.dir_mappings)
spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.raw_spec_files, jasmine_runner) spec_builder = Jasmine::SpecBuilder.new(JasmineHelper.raw_spec_files, jasmine_runner)

View File

@ -65,4 +65,4 @@ jasmine.Runner.prototype.suites = function() {
jasmine.Runner.prototype.results = function() { jasmine.Runner.prototype.results = function() {
return this.queue.results(); return this.queue.results();
}; };

View File

@ -43,6 +43,11 @@ jasmine.Spec.prototype.log = function(message) {
return this.results_.log(message); return this.results_.log(message);
}; };
/** @deprecated */
jasmine.Spec.prototype.getResults = function() {
return this.results_;
};
jasmine.Spec.prototype.runs = function (func) { jasmine.Spec.prototype.runs = function (func) {
var block = new jasmine.Block(this.env, func, this); var block = new jasmine.Block(this.env, func, this);
this.addToQueue(block); this.addToQueue(block);

View File

@ -28,16 +28,14 @@ jasmine.UPDATE_INTERVAL = 250;
*/ */
jasmine.bindOriginal_ = function(base, name) { jasmine.bindOriginal_ = function(base, name) {
var original = base[name]; var original = base[name];
return function() { if (original.apply) {
if (original.apply) { return function() {
return original.apply(base, arguments); return original.apply(base, arguments);
} else { };
//IE support } else {
if (base == window) { // IE support
return window[name].apply(window, arguments); return window[name];
} }
}
};
}; };
jasmine.setTimeout = jasmine.bindOriginal_(window, 'setTimeout'); jasmine.setTimeout = jasmine.bindOriginal_(window, 'setTimeout');