-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
150 additions
and
0 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
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,16 @@ | ||
var renderer; | ||
describe( | ||
"AllocationRenderer", | ||
function() { | ||
renderer = new AllocationRenderer(function() { | ||
// | ||
}, {}); | ||
}, | ||
function() { | ||
describe("makeUpMissingFormat", function() { | ||
it("should be tasty", function() { | ||
expect(renderer.makeUpMissingFormat('someKey')).toMatch(''); | ||
}); | ||
}); | ||
} | ||
); |
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,23 @@ | ||
var data; | ||
describe( | ||
"Non-Empty Data", | ||
function() { | ||
data = new PickyData({ | ||
total: 123, | ||
duration: 0.000123, | ||
offset: 12, | ||
allocations: ['test', 3.14, 123, [['attr1', 'Original1', 'parsed1'], ['attr2', 'Original2', 'parsed2']]] | ||
}); | ||
}, | ||
function() { | ||
describe( | ||
"isEmpty", | ||
null, | ||
function() { | ||
it("is correct", function() { | ||
return !data.isEmpty(); | ||
}); | ||
} | ||
); | ||
} | ||
); |
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,57 @@ | ||
var array; | ||
describe( | ||
"Array", | ||
function() { | ||
array = [1,2,3,4,5]; | ||
}, | ||
function() { | ||
describe( | ||
"index", | ||
null, | ||
function() { | ||
it("indexes correctly", function() { | ||
return array.index(0) == null; | ||
}); | ||
it("indexes correctly", function() { | ||
return array.index(3) == 2; | ||
}); | ||
} | ||
); | ||
describe( | ||
"include", | ||
null, | ||
function() { | ||
it("is correct", function() { | ||
return !array.include(0); | ||
}); | ||
it("is correct", function() { | ||
return array.include(3); | ||
}); | ||
} | ||
); | ||
describe( | ||
"compare", | ||
null, | ||
function() { | ||
it("is correct", function() { | ||
return [].compare([]); | ||
}); | ||
it("is correct", function() { | ||
return [1,2,3].compare([1,2,3]); | ||
}); | ||
} | ||
); | ||
describe( | ||
"include", | ||
null, | ||
function() { | ||
it("is correct", function() { | ||
return array.remove(0).compare([2,3,4,5]); | ||
}); | ||
it("is correct", function() { | ||
return array.remove(3).compare([2,3,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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// This file defines global helper functions for specs | ||
// | ||
// js specs are intended to be run with the mozilla js standalone lib: | ||
// http://www.ossp.org/pkg/lib/js/ | ||
// | ||
// Output is intended to be used in a html wrapper, as in TextMate. | ||
|
||
// The tester function. | ||
// | ||
it = function(should, callback) { | ||
var result = callback(); | ||
if (result) { | ||
print('.'); | ||
} else { | ||
print('F'); | ||
}; | ||
}; | ||
|
||
// For defining a context. | ||
// | ||
context = function(description, setup, specs, breakdown) { | ||
var old_description = this.context_description; | ||
var pre_description = old_description ? old_description + ' ' : ''; | ||
|
||
// framework setup | ||
this.context_description = pre_description + description; // sets the description on the global object | ||
|
||
if (setup) { setup(); }; | ||
specs(); | ||
if (breakdown) { breakdown(); }; | ||
|
||
// framework breakdown | ||
this.context_description = old_description; | ||
}; | ||
|
||
// Alias describe to context. | ||
// | ||
describe = context; |
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,12 @@ | ||
# js -f spec_helper.js \ | ||
# -f source/picky.translations.js \ | ||
# -f source/picky.allocation_renderer.js \ | ||
# spec/picky.allocation_renderer.spec.js | ||
|
||
js -f spec_helper.js \ | ||
-f source/picky.extensions.js \ | ||
spec/picky.extensions.spec.js | ||
|
||
js -f spec_helper.js \ | ||
-f source/picky.data.js \ | ||
spec/picky.data.spec.js |