diff --git a/test/jsUnitMockTimeout.js b/lib/jsUnitMockTimeout.js
similarity index 100%
rename from test/jsUnitMockTimeout.js
rename to lib/jsUnitMockTimeout.js
diff --git a/test/bootstrap.html b/spec/bootstrap.html
similarity index 86%
rename from test/bootstrap.html
rename to spec/bootstrap.html
index 17f8297..8d03e2c 100755
--- a/test/bootstrap.html
+++ b/spec/bootstrap.html
@@ -3,9 +3,10 @@
Jasmine Tests
-
-
-
+
+
+
+
@@ -19,9 +20,10 @@
-
-
+
+
+
diff --git a/test/bootstrap.js b/spec/bootstrap.js
similarity index 99%
rename from test/bootstrap.js
rename to spec/bootstrap.js
index a8d46db..55d2baf 100755
--- a/test/bootstrap.js
+++ b/spec/bootstrap.js
@@ -278,24 +278,20 @@ var runTests = function () {
runSuite('PrettyPrintTest.js');
runSuite('MatchersTest.js');
runSuite('SpecRunningTest.js');
- testRunnerFinishCallback();
runSuite('NestedResultsTest.js');
- testFormatsExceptionMessages();
- testHandlesExceptions();
- testResultsAliasing();
runSuite('ReporterTest.js');
runSuite('RunnerTest.js');
runSuite('JsonReporterTest.js');
runSuite('SpyTest.js');
- testExplodes();
-
+
+ testRunnerFinishCallback();
+ testFormatsExceptionMessages();
+ testHandlesExceptions();
+ testResultsAliasing();
// handle blank specs will work later.
// testHandlesBlankSpecs();
-
reporter.summary();
document.getElementById('spinner').style.display = "none";
-
-};
-
+};
\ No newline at end of file
diff --git a/test/json2.js b/spec/lib/json2.js
similarity index 100%
rename from test/json2.js
rename to spec/lib/json2.js
diff --git a/test/mock-timeout.js b/spec/lib/mock-timeout.js
similarity index 100%
rename from test/mock-timeout.js
rename to spec/lib/mock-timeout.js
diff --git a/spec/runner.html b/spec/runner.html
new file mode 100644
index 0000000..11c2b7a
--- /dev/null
+++ b/spec/runner.html
@@ -0,0 +1,74 @@
+
+
+
+ Jasmine Test Runner
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/JsonReporterTest.js b/spec/suites/JsonReporterTest.js
similarity index 100%
rename from test/JsonReporterTest.js
rename to spec/suites/JsonReporterTest.js
diff --git a/test/MatchersTest.js b/spec/suites/MatchersTest.js
similarity index 100%
rename from test/MatchersTest.js
rename to spec/suites/MatchersTest.js
diff --git a/test/NestedResultsTest.js b/spec/suites/NestedResultsTest.js
similarity index 100%
rename from test/NestedResultsTest.js
rename to spec/suites/NestedResultsTest.js
diff --git a/test/PrettyPrintTest.js b/spec/suites/PrettyPrintTest.js
similarity index 100%
rename from test/PrettyPrintTest.js
rename to spec/suites/PrettyPrintTest.js
diff --git a/test/ReporterTest.js b/spec/suites/ReporterTest.js
similarity index 100%
rename from test/ReporterTest.js
rename to spec/suites/ReporterTest.js
diff --git a/test/RunnerTest.js b/spec/suites/RunnerTest.js
similarity index 100%
rename from test/RunnerTest.js
rename to spec/suites/RunnerTest.js
diff --git a/test/SpecRunningTest.js b/spec/suites/SpecRunningTest.js
similarity index 97%
rename from test/SpecRunningTest.js
rename to spec/suites/SpecRunningTest.js
index 3a3abc9..f3c2098 100644
--- a/test/SpecRunningTest.js
+++ b/spec/suites/SpecRunningTest.js
@@ -672,6 +672,7 @@ describe("jasmine spec running", function () {
suite.execute();
fakeTimer.tick(600);
+
expect(suite.specs[0].foo).toEqual(2); // "Spec does not maintain scope in between functions");
expect(suite.specs[0].results.getItems().length).toEqual(2); // "Spec did not get results for all expectations");
expect(suite.specs[0].results.getItems()[0].passed).toEqual(false); // "Spec did not return false for a failed expectation");
@@ -698,7 +699,7 @@ describe("jasmine spec running", function () {
it('shouldn\'t execute specs in disabled suites', function() {
var spy = jasmine.createSpy();
- var disabledSuite = xdescribe('a disabled suite', function() {
+ var disabledSuite = env.xdescribe('a disabled suite', function() {
it('enabled spec, but should not be run', function() {
spy();
});
@@ -709,4 +710,21 @@ describe("jasmine spec running", function () {
expect(spy).wasNotCalled();
});
+ it('#explodes should throw an exception when it is called inside a spec', function() {
+ var exceptionMessage = false;
+ var suite = env.describe('Spec', function () {
+ it('plodes', function() {
+ try {
+ jasmine.explodes();
+ }
+ catch (e) {
+ exceptionMessage = e;
+ }
+ expect(exceptionMessage).toNotEqual(false);
+ });
+ });
+ suite.execute();
+
+ expect(exceptionMessage).toEqual('explodes function should not have been called');
+ });
});
diff --git a/test/SpyTest.js b/spec/suites/SpyTest.js
similarity index 100%
rename from test/SpyTest.js
rename to spec/suites/SpyTest.js
diff --git a/src/base.js b/src/base.js
index d63cca3..b0e6ffb 100755
--- a/src/base.js
+++ b/src/base.js
@@ -5,9 +5,6 @@
/** @namespace */
var jasmine = {};
-/** @deprecated use jasmine (lowercase because it's a package name) instead */
-var Jasmine = jasmine;
-
jasmine.unimplementedMethod_ = function() {
throw new Error("unimplemented method");
};
@@ -64,7 +61,6 @@ jasmine.any = function(clazz) {
return new jasmine.Matchers.Any(clazz);
};
-
jasmine.createSpy = function(name) {
var spyObj = function() {
spyObj.wasCalled = true;
@@ -135,7 +131,6 @@ var it = function(desc, func) {
return jasmine.getEnv().it(desc, func);
};
-//this mirrors the spec syntax so you can define a spec description that will not run.
var xit = function(desc, func) {
return jasmine.getEnv().xit(desc, func);
};
@@ -210,4 +205,4 @@ jasmine.include = function(url, opt_global) {
return eval(xhr.responseText);
}
-};
+};
\ No newline at end of file
diff --git a/test/mock-ajax.js b/test/mock-ajax.js
deleted file mode 100644
index c7eee61..0000000
--- a/test/mock-ajax.js
+++ /dev/null
@@ -1,57 +0,0 @@
-jasmine.AjaxRequests = {
- requests: $A(),
-
- activeRequest: function() {
- return this.requests.last();
- },
-
- add: function(request) {
- this.requests.push(request);
- var spec = jasmine.getEnv().currentSpec;
- spec.after(function() { jasmine.AjaxRequests.clear(); });
- },
-
- remove: function(request) {
- this.requests = this.requests.without(request);
- },
-
- clear: function() {
- this.requests.clear();
- }
-};
-
-jasmine.AjaxRequest = Class.create(Ajax.Request, {
- request: function(url) {
- this.url = url;
- this.method = this.options.method;
- var params = Object.clone(this.options.parameters);
-
- if (!['get', 'post'].include(this.method)) {
- // simulate other verbs over post
- params['_method'] = this.method;
- this.method = 'post';
- }
-
- this.parameters = params;
-
- if (params = Object.toQueryString(params)) {
- // when GET, append parameters to URL
- if (this.method == 'get')
- this.url += (this.url.include('?') ? '&' : '?') + params;
- else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
- params += '&_=';
- }
-
- jasmine.AjaxRequests.add(this);
- },
-
- response: function(response) {
- if (!response.status || response.status == 200 || response.status == "200") {
- if (this.options.onSuccess) {this.options.onSuccess(response);}
- } else {
- if (this.options.onFailure) {this.options.onFailure(response);}
- }
- if (this.options.onComplete) {this.options.onComplete(response);}
- jasmine.AjaxRequests.remove(this);
- }
-});
diff --git a/test/prototype-1.6.0.3.js b/test/prototype-1.6.0.3.js
deleted file mode 100755
index dfe8ab4..0000000
--- a/test/prototype-1.6.0.3.js
+++ /dev/null
@@ -1,4320 +0,0 @@
-/* Prototype JavaScript framework, version 1.6.0.3
- * (c) 2005-2008 Sam Stephenson
- *
- * Prototype is freely distributable under the terms of an MIT-style license.
- * For details, see the Prototype web site: http://www.prototypejs.org/
- *
- *--------------------------------------------------------------------------*/
-
-var Prototype = {
- Version: '1.6.0.3',
-
- Browser: {
- IE: !!(window.attachEvent &&
- navigator.userAgent.indexOf('Opera') === -1),
- Opera: navigator.userAgent.indexOf('Opera') > -1,
- WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
- Gecko: navigator.userAgent.indexOf('Gecko') > -1 &&
- navigator.userAgent.indexOf('KHTML') === -1,
- MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
- },
-
- BrowserFeatures: {
- XPath: !!document.evaluate,
- SelectorsAPI: !!document.querySelector,
- ElementExtensions: !!window.HTMLElement,
- SpecificElementExtensions:
- document.createElement('div')['__proto__'] &&
- document.createElement('div')['__proto__'] !==
- document.createElement('form')['__proto__']
- },
-
- ScriptFragment: '