Assert_value - ExUnit's assert on steroids that writes and updates tests for you

New version 0.8.2 has been released

New Features

Previous version supported only argument types which implemented String.Chars protocol on the left and string heredocs on the right. 0.8.2 supports all argument types (e.g. Integer, List, Map) except not serializable (e.g. Function, PID, Reference) So now you can write

assert_value 2 + 2 == 4
assert_value %{a: true} == %{a: true}

Enhancements

  • Better parser now supports any kind of formatting (expressions, parentheses, multi-line, etc.)
  • Better formatter (smarter formatting one-line and multi-line strings)
  • Better error reporting
  • Ensure compatibility with Elixir 1.6

Upgrade Instructions

  • Run mix test. You may get diffs because assert_value no longer converts everything to a string
  • Run ASSERT_VALUE_ACCEPT_DIFFS=reformat mix test to take advantage of improved formatter
  • Add this to .formatter.exs to make Elixir formatter not to add parens to assert_value
    [
      import_deps: [:assert_value]
    ]
    
4 Likes