Elektrine lite

← Feed

@paulshryock@phpc.social

Post #4118940

2026-07-26 18:57 UTC

Since any good testing framework should probably have assertions, I've created an `expect_to_be` function which compares numbers, strings, arrays, and dictionaries. ```bash it "should compare two words" $(expect_to_be yes no) ``` (The above example would fail because `yes` and `no` are not the same.)

Replies (1)

  • @paulshryock@phpc.social 2026-07-26 18:58

    I still don't _love_ this API... I think `expect` should be it's own function or maybe an argument to `it`, and then `to_be` should be the function which handles the assertion. That would look like: ```bash it "should compare two words" expect $(to_be yes no) ```

    Open ##4118939