Commit Graph
72 Commits
Author SHA1 Message Date
José Valim 820d0cb9a0 Print failures for ExUnit as soon as they come 2013-08-22 11:12:18 +02:00
José Valim a86288f5e3 Merge pull request #1597 from thmzlt/doctest_indent
Improve DocTest indentation handling
2013-08-14 23:51:17 -07:00
José Valim db47bd56b4 Add Path.relative_to_cwd and rely on it when generating stacktraces 2013-08-14 12:36:54 +02:00
Thomaz Leite e4d679c039 Add "too much" and "not enough" tests to DocTest 2013-08-13 23:13:45 -07:00
Thomaz Leite 649536fc61 Add mismatched indentation test to DocTest 2013-08-13 23:13:45 -07:00
Thomaz Leite bdf7bc5e6c Add heredocs indentation test to DocTest 2013-08-13 23:13:45 -07:00
José Valim 9cd6b528c9 Get rid of unmatched docs warnings 2013-07-23 23:37:37 +02:00
José Valim accf7dac82 Change inspect formatting to use spaces in between , 2013-07-06 10:07:54 +02:00
José Valim acf912c2c8 Clean up ExUnit.CaseTemplate to allow composition 2013-07-03 21:29:35 +02:00
José Valim cdd8e5862d Rename the ExUnit option from debug to trace 2013-07-01 16:41:34 +02:00
José Valim 3bac4ddec6 Support --debug on internal tests which are not run through mix 2013-07-01 14:20:33 +02:00
José Valim 595d343e05 Refactor and improve coverage of ExUnit formatters 2013-07-01 13:18:26 +02:00
José Valim 6cee8572e0 Clean up ExUnit tests 2013-06-21 15:16:02 +02:00
vanstee f2d9e802cd Include description and improve formatting
Switching from `AssertionError` to `ExpectationError` gives us a nicer
error message and allows us to easily include the incorrect result as a
description.

Fixes #1276

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2013-06-21 15:08:48 +02:00
vanstee 561d6ea0d1 Show original statement if assert or refute fails
If the asserted statement evaluates to false, show the unevaluated
statement in the assertion error output message for more context about
the failure. Refute also now follows similar semantics.

Fixes #1276
2013-06-20 16:17:55 -04:00
Rafael Mendonça França 7cdc25538e Uniform use of whitespace after commas on codebase
This make easier to read and also follow some standard in the code
2013-06-15 16:52:48 -03:00
Alexei Sholik 4a1dfccbec Use =~ with strings where it makes sense 2013-06-08 15:58:34 +03:00
José Valim c78d3b3717 Clean up DocTestTest 2013-06-05 18:00:26 +08:00
Yuki Ito 1fa29be448 Option that enable to decide whether capture_io captures a prompt or not 2013-06-02 19:15:06 +09:00
Yuki Ito 9840ac266b capture_io captures a prompt when capturing of stdio 2013-06-01 17:07:28 +09:00
Alexei Sholik 4ce444ad76 Include location info in the multiple exceptions error 2013-05-29 00:34:18 +03:00
Alexei Sholik da4565ee88 Don't test DocTest's doctests 2013-05-28 19:07:30 +03:00
Alexei Sholik 7044f9c9da Add a test for leaking vars 2013-05-28 16:36:32 +03:00
Alexei Sholik 5aa5268c5b Implement extended doctest sessions. Closes #1020 2013-05-28 13:53:18 +03:00
Yuki Ito 97ea102a79 Enable ExUnitCaptureIO.capture_io to receive input 2013-05-23 00:45:06 +09:00
José Valim c3d6a96dac Consider load time on ExUnit reports, closes #893 2013-05-21 12:57:22 +02:00
José Valim abc5d6f954 Also allow explicitly capturing of stdio and stderr 2013-05-15 10:19:01 -06:00
José Valim ad2a6774b1 Ensure no group_leader leakage on capture_io and remove stderr test which was printing on run 2013-05-15 10:02:29 -06:00
Yuki Ito 66eb369b3d Implement capture_io for ex_unit 2013-05-15 19:12:50 +09:00
José Valim 8de27bf9af Clean up and speed up exceptions 2013-05-12 20:51:39 -06:00
José Valim cbe82e0912 Add __DIR__, closes #1019 2013-05-06 11:03:37 -06:00
José Valim 5841f6849b Deprecate assert inlist in favor of assert in 2013-05-05 09:52:00 -06:00
Yurii Rashkovskii 6512fcb06e Add import: option to doctests. It is false by default. 2013-04-11 03:29:32 -07:00
José Valim 025c425514 Split doctests that expect an exception from the ones who does not 2013-04-09 23:58:43 -07:00
José Valim 48da7e8ed7 Allow doctests to be defined dynamically 2013-04-09 23:31:09 -07:00
Yurii Rashkovskii dbf711b519 Add support for exception tracking in DocTest 2013-04-09 17:42:54 -07:00
Yurii Rashkovskii 0b0bbdee5e Initial ExUnit.DocTest implementation 2013-04-09 13:42:19 -07:00
José Valim 369fd7506c Ensure unquotes are respected in the test macro 2013-03-26 13:36:54 -06:00
José Valim 4cc92aaf8d Improve formatting for assert left = right 2013-02-28 08:14:57 -07:00
José Valim 6a24bc4ef3 Add elapsed times to ExUnit runs 2013-02-19 08:57:42 -07:00
José Valim 8a58722dd0 ANSIfy ExUnit formatter 2013-02-18 17:57:43 -07:00
José Valim 7dd0aabbe2 Deprecate ExUnit.after_spawn callbacks 2013-02-17 20:46:58 -07:00
José Valim 658d7c7913 ExUnit callbacks must return :ok or { :ok, data } 2013-02-17 20:43:01 -07:00
José Valim 1f491dfbe2 Add support to case templates 2013-02-17 20:43:01 -07:00
José Valim 8f57b4c9af Add metadata support to ExUnit
Defining setup/teardown/test explicitly is now deprecated.
They should now be defined via their respective macros:

    def setup do
      ...
    end

Now becomes:

    setup do
      ...
    end

When defined using the new format, setup callbacks can
return metadata:

    setup do
      [do_this: :do_that]
    end

And now the test macro can access this metadata:

    test "check metadata", data do
      assert data[:do_this] == :do_that
    end
2013-02-17 18:23:31 -07:00
José Valim fda6f0ce09 Move path related functions from File to Path 2013-01-19 09:36:03 -07:00
José Valim 09f61abe27 Add assert_receive and refute_receive to ExUnit 2012-12-26 17:28:10 +01:00
José Valim 0369d1652f Add ExUnit.ExpectationError and move special formating to ExUnit.CLIFormatter 2012-12-17 10:59:41 +01:00
Oren Ben-Kiki 8e2a30906a Align expected and actual values in assertion failure messages. 2012-12-15 00:01:35 +02:00
José Valim 1105781606 ExUnit supports many manual runs 2012-12-08 12:04:26 +01:00