antonmi/espec

More readable syntax?

开放

#300 创建于 2020年8月14日

 (7 条评论) (0 个反应) (0 位负责人)Elixir (67 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (814 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

I don't understand why you chose to use this for your syntax:

expect actual |> to(eq expected)

rather than this:

expect(actual).to.eq.(expected)

The second seems far more readable to me. Like, obviously the pipe operator is a core part of Elixir to the point that everyone programming in Elixir is going to understand it, but simple English is still more readable, and that goes doubly so when the more English syntax ends up being almost exactly the same as Ruby and close to the same as JavaScript, and triply so when the basic point of this library is to make more readable tests than ExUnit, in a style more like RSpec.

贡献者指南