SimpleServer.start now takes optional array of stylesheet paths for runner
This commit is contained in:
parent
c164d58a1a
commit
92ffcb47e2
@ -61,13 +61,14 @@ module Jasmine
|
||||
end
|
||||
|
||||
class RunAdapter
|
||||
def initialize(spec_files_or_proc, jasmine_files = nil)
|
||||
def initialize(spec_files_or_proc, jasmine_files = nil, stylesheets = [])
|
||||
@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"
|
||||
]
|
||||
@stylesheets = ["/__JASMINE_ROOT__/lib/jasmine.css"] + stylesheets
|
||||
end
|
||||
|
||||
def call(env)
|
||||
@ -77,7 +78,7 @@ module Jasmine
|
||||
jasmine_files = @jasmine_files
|
||||
jasmine_files = jasmine_files.call if jasmine_files.respond_to?(:call)
|
||||
|
||||
css_files = ["/__JASMINE_ROOT__/lib/jasmine.css"]
|
||||
css_files = @stylesheets
|
||||
|
||||
body = ERB.new(File.read(File.join(File.dirname(__FILE__), "run.html"))).result(binding)
|
||||
[
|
||||
@ -113,12 +114,12 @@ module Jasmine
|
||||
end
|
||||
|
||||
class SimpleServer
|
||||
def self.start(port, spec_files_or_proc, mappings, jasmine_files = nil)
|
||||
def self.start(port, spec_files_or_proc, mappings, jasmine_files = nil, stylesheets = [])
|
||||
require 'thin'
|
||||
|
||||
config = {
|
||||
'/run.html' => Jasmine::Redirect.new('/'),
|
||||
'/' => Jasmine::RunAdapter.new(spec_files_or_proc, jasmine_files)
|
||||
'/' => Jasmine::RunAdapter.new(spec_files_or_proc, jasmine_files, stylesheets)
|
||||
}
|
||||
mappings.each do |from, to|
|
||||
config[from] = Rack::File.new(to)
|
||||
|
@ -258,7 +258,7 @@ ul.inheritsList
|
||||
</div>
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:34 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -300,7 +300,7 @@ ul.inheritsList
|
||||
</div>
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:34 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -908,7 +908,7 @@ A convenience method that allows existing specs to be disabled temporarily durin
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -339,7 +339,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -507,7 +507,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -316,7 +316,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -316,7 +316,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -700,7 +700,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -316,7 +316,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -418,7 +418,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -396,7 +396,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -845,7 +845,7 @@ expect(foo.bar.callCount).toEqual(0);</pre>
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:34 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -436,7 +436,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:34 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -728,7 +728,7 @@ Jasmine environment.
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:33 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -316,7 +316,7 @@ ul.inheritsList
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:15:02 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 13 2009 14:46:34 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -189,6 +189,7 @@ jasmine.Spy = function(name) {
|
||||
* mySpy.argsForCall[1] = [7, 8];
|
||||
*/
|
||||
this.argsForCall = [];
|
||||
this.calls = [];
|
||||
};
|
||||
|
||||
/**
|
||||
@ -283,6 +284,7 @@ jasmine.Spy.prototype.reset = function() {
|
||||
this.wasCalled = false;
|
||||
this.callCount = 0;
|
||||
this.argsForCall = [];
|
||||
this.calls = [];
|
||||
this.mostRecentCall = {};
|
||||
};
|
||||
|
||||
@ -292,13 +294,10 @@ jasmine.createSpy = function(name) {
|
||||
spyObj.wasCalled = true;
|
||||
spyObj.callCount++;
|
||||
var args = jasmine.util.argsToArray(arguments);
|
||||
//spyObj.mostRecentCall = {
|
||||
// object: this,
|
||||
// args: args
|
||||
//};
|
||||
spyObj.mostRecentCall.object = this;
|
||||
spyObj.mostRecentCall.args = args;
|
||||
spyObj.argsForCall.push(args);
|
||||
spyObj.calls.push({object: this, args: args});
|
||||
return spyObj.plan.apply(this, arguments);
|
||||
};
|
||||
|
||||
@ -523,7 +522,7 @@ jasmine.version_= {
|
||||
"major": 0,
|
||||
"minor": 9,
|
||||
"build": 0,
|
||||
"revision": 1255468502
|
||||
"revision": 1255470394
|
||||
};
|
||||
/**
|
||||
* @namespace
|
||||
|
Loading…
Reference in New Issue
Block a user