moved frameworks to a separate directory; made a sample spec helper that installs correct Ajax library. Protoype is GREEN

This commit is contained in:
Davis W. Frank, dwfrank & Hunter Gillane 2010-09-16 17:30:06 -07:00
parent 5833dd806c
commit ace08b274e
5 changed files with 21 additions and 4 deletions

View File

@ -11,7 +11,7 @@
# - dist/**/*.js
#
src_files:
- lib/prototype.js
- frameworks/prototype.js
- examples/prototype/public/javascripts/**/*.js
# stylesheets
@ -38,8 +38,8 @@ stylesheets:
# - helpers/**/*.js
#
helpers:
- lib/spec-helper.js
- examples/prototype/spec/javascripts/helpers/**/*.js
- spec/javascripts/helpers/spec-helper.js
# spec_files
#

16
lib/spec-helper.js Normal file
View File

@ -0,0 +1,16 @@
beforeEach(function() {
if (typeof jQuery != 'undefined') {
spyOn(jQuery.ajaxSettings, 'xhr').andCallFake(function() {
var newXhr = new FakeXMLHttpRequest();
ajaxRequests.push(newXhr);
return newXhr;
});
} else {
spyOn(Ajax, "getTransport").andCallFake(function() {
return new FakeXMLHttpRequest();
});
}
clearAjaxRequests();
});

View File

@ -1,8 +1,9 @@
src_dir: .
src_files:
- lib/prototype.js
- lib/**/*.js
- frameworks/prototype.js
- frameworks/jquery.js
- lib/mock-ajax.js
spec_dir: