double v0.7.0 Release Notes

Release Date: 2019-04-22 // almost 5 years ago
  • ๐Ÿš€ This release adds the new stub syntax which is a great improvement over the old double/allow syntax. stub combines both into one function now:

    dbl = ModuleOrBehavior
    |> stub(:function_name, fn(x) -> x end)
    |> stub(:another_function, fn(x) -> x end)
    dbl.function_name("hello")
    assert_receive({ModuleOrBehavior, :function_name, ["hello"]})
    

    You'll notice that the message now contains the module or behavior atom that the stub is built against. This prevents conflicts w/ function names between different modules and is another improvement that the stub syntax provides.

    ๐Ÿ—„ The old double/allow syntax is no longer documented, but isn't marked as deprecated yet. We may consider that in the future, or maybe even dropping support for it in version 1.0.

    ๐Ÿ“„ For more details on the new syntax, please read the docs!


Previous changes from v0.6.6

  • ๐Ÿš€ This release includes fixes to prevent conflicts with auto imported functions from Kernel. Thanks to @JonRowe for the contribution!