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
do_something_with_fixtures_test_() -> | |
{ | |
setup, | |
fun setup/0, | |
fun cleanup/1, | |
?_test( | |
begin | |
?assertEqual(1, 2) | |
end)}. |
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
-module(square). | |
-export([square/1]). | |
square(X) -> | |
X * X. |
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
-module(square_test). | |
-include_lib("eunit/include/eunit.hrl"). | |
square_0_test() -> | |
?assertEqual(0, square:square(0)). | |
square_1_test() -> | |
?assertEqual(1, square:square(1)). | |
square_2_test() -> |
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
-module(tests). | |
-export([run/0]). | |
run() -> | |
io:format("Running Tests"), | |
eunit:test("ebin/"), | |
init:stop(). | |
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
test: all | |
erl -run tests run |
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
-module(cover). | |
-export([ cover/0]). | |
cover()-> | |
io:format("~n********************************************************************************~n"), | |
io:format("Running Tests~n~n"), | |
cover:start(), | |
_R = cover:compile_beam_directory("ebin/"), | |
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
(defun run-phantomjs () | |
(message "Phantom JS: %s" | |
(shell-command-to-string | |
"phantomjs run-qunit.js http://localhost:8080/test.html|tail -1"))) | |
(add-hook 'after-save-hook 'run-phantomjs) |
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
Backbone.sync = (method, collection, {url: url}) -> | |
collection.reset(My.Sync.data[url]) |
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
myModel.on("xyzzy", function () { | |
alert("XYZZY"); | |
}); | |
myModel.trigger("xyzzy"); |
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
_.map([1,2,3,4], function (x) {return x*x;}) //> [1,4, 9, 16] |
OlderNewer