-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reengineered EnvJasmine to better integrate with Maven
- Loading branch information
Showing
14 changed files
with
174 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Version 1.4: Reengineered system to better integrate with maven (03/07/2011) | ||
|
||
Version 1.3: Added support for arbitrary file structures in specs directory (02/15/2011) | ||
|
||
Version 1.2: Improved Maven integration support (01/27/2011) | ||
|
||
Version 1.1: Added support for AJAX calls (01/24/2011) | ||
|
||
Version 1.0: Initial Release (01/07/2011) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2010-2011 Jeff Avallone and Trevor Lalish-Menagh | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd "`dirname \"$0\"`" | ||
java -Duser.timezone="US/Eastern" -jar ../lib/rhino/js.jar ../lib/envjasmine.js `find ../specs -name *.spec.js` | ||
PWD=$(pwd) | ||
java -Duser.timezone="US/Eastern" -jar "$PWD/../lib/rhino/js.jar" "$PWD/../lib/envjasmine.js" "$PWD/.." `find "$PWD/../specs" -name *.spec.js` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd "`dirname \"$0\"`" | ||
java -Duser.timezone="US/Eastern" -jar ../lib/rhino/js.jar ../lib/envjasmine.js ../$1 | ||
PWD=$(pwd) | ||
java -Duser.timezone="US/Eastern" -jar "$PWD/../lib/rhino/js.jar" "$PWD/../lib/envjasmine.js" "$PWD/.." "$PWD/../$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// spanDir - a directory traversal function for | ||
// Rhino JavaScript | ||
// Copyright 2010 by James K. Lawless | ||
// See MIT/X11 license at | ||
// http://www.mailsend-online.com/wp/license.php | ||
|
||
importPackage(java.io); | ||
|
||
// spanDir() accepts two parameters | ||
// The first is a string representing a directory path | ||
// The second is a closure that accepts a parameter of type | ||
// java.io.File | ||
function spanDir(dir,dirHandler) { | ||
var lst=new File(dir).listFiles(), | ||
i; | ||
|
||
for(i=0;i<lst.length;i++) { | ||
// If it's a directory, recursive call spanDir() | ||
// so that we end up doing a scan of | ||
// the directory tree | ||
if(lst[i].isDirectory()) { | ||
spanDir(lst[i].getCanonicalPath(),dirHandler); | ||
} | ||
// Pass the File object to the handler that | ||
// the caller has specified regardless of whether | ||
// the File object is a directory. | ||
dirHandler(lst[i].getCanonicalPath()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Add mocks here for use in your specs. | ||
// A mock is a simple JavaScript object that you will use to fake data. | ||
var demoUser = { | ||
name: "Trevor", | ||
birthdate: "3/2/1977" | ||
}, | ||
badUser = { | ||
name: "BadGuy" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// This is the contents of ajaxDemo.js, the file to test. | ||
var TwitterWidget = { | ||
makeRequest: function() { | ||
var self = this; | ||
|
||
$.ajax({ | ||
method: "GET", | ||
url: "http://api.twitter.com/1/statuses/show/trevmex.json", | ||
datatype: "json", | ||
success: function (data) { | ||
self.addDataToDOM(data); | ||
} | ||
}); | ||
}, | ||
|
||
addDataToDOM: function(data) { | ||
// does something | ||
// We will mock this behavior with a spy. | ||
|
||
return data; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Sample demo | ||
|
||
if (!this.Demo) { | ||
Demo = {}; | ||
} | ||
|
||
Demo.checkBirthdate = function (user) { | ||
return !user.birthdate ? false : true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters