Skip to content

v4.8.0: NixOS support

Compare
Choose a tag to compare
@edouard-lopez edouard-lopez released this 30 Aug 21:47
· 70 commits to master since this release

What's Changed

NixOS Support

Some of the tests and test utils assumed they were ran by $USER=nemo. This is not the case in NixOS and probably other distros as well. We fixed the tests for NixOS, but there is still work to do ensure

CI

NixOS Job

We added a job to run the test again NixOS 2.17.0 using Fish 3.6.1 only

image

Dropping Versions Support

The following versions have been dropped, following our Versions Support Strategy

- Fish: 3.0.2
- Fish: 3.1.2
- Fish: 3.2.2
- Fish: 3.3.1

Mocks

We recently introduced a set of helpers functions to mock and spy system or pure's function. Here is a summary, but be sure to check the content of https://github.com/pure-fish/pure/tree/master/tests/mocks for implementation details.

Mocking

  • _mock: Mock a function using the mock in tests/mocks/
    • function_name: name of the method to mock
  • _mock_exit_status: Mock a response exit status for a mock function
    • function_name: name of the method to mock
    • status_code: response to return
  • _mock_response: Mock a response for a mock function
    • function_name: name of the method to mock
    • response: response to return
  • _clean_mock: Clean a mock function (warning: erase the function)
    • function_name: name of the method to mock

Spying

  • _spy: Create a spy method so, you can check it's been called with _has_called
    • function_name: name of the method to spy
  • _has_called: check spy method has been called, i.e has written to the /tmp/$function_name.mock_calls
    • function_name: name of the that have been spied on
    • function_args # arguments to passed to the spy

Cleaning

  • _clean_all_mocks: Clean all mock functions created by _mock
  • _pure_unmock: Restore a pure function by reloading its source
    • function_name: name of the method to mock
  • _clean_all_spy_calls: Clean all spy calls created by _spy

⬇️ Installation

fisher update pure-fish/pure; or fisher install pure-fish/pure

👏 Thanks

  • @pacien for spotting the issue, providing feedback about NixOS and his patience

Full Changelog: v4.7.1...v4.8.0