Created
May 30, 2010 10:01
-
-
Save nrk/418929 to your computer and use it in GitHub Desktop.
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
require 'luarocks.require' | |
require 'telescope' | |
function raise_error() error("whoops") end | |
function do_not_raise_error() return true end | |
context("assert_error", function() | |
test("with error being raised", function() | |
assert_error(raise_error) | |
end) | |
test("with error not being raised", function() | |
assert_error(do_not_raise_error) | |
end) | |
test("does not break the entire test suite", function() | |
assert_error(raise_error) | |
end) | |
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
^C------------------------------------------------------------------------ | |
assert_error: | |
with error being raised [P] | |
with error not being raised [E] | |
does not break the entire test suite [P] | |
------------------------------------------------------------------------ | |
3 tests 2 passed 3 assertions 0 failed 1 error 0 unassertive 0 pending | |
with error not being raised: | |
...e/.luarocks/rocks//telescope/scm-1/lua/telescope.lua:147: interrupted! | |
stack traceback: | |
...e/.luarocks/rocks//telescope/scm-1/lua/telescope.lua:374: in function 'invoke_test' | |
...e/.luarocks/rocks//telescope/scm-1/lua/telescope.lua:399: in function 'run' | |
...ome/adaniele/.luarocks/rocks/telescope/scm-1/bin/tsc:266: in main chunk | |
[C]: ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment