Computer stuff, OCaml

Using fixture files in OCaml tests with Dune

The post discusses the author’s experience with OCaml’s build system, Dune, particularly focusing on using fixture files for unit tests. The author encountered a challenge with test file accessibility during build. Ultimately, they discovered a solution by adding a dependency in the Dune configuration, enhancing their understanding of the tool.

Computer stuff, Ruby

Rails API and timestamps shenanigans

The article discusses an issue encountered while upgrading an API from Rails 6 to Rails 7, specifically regarding timestamp precision in request specs. It highlights how Rails truncates timestamps to milliseconds, causing test failures. The solution is to adjust the ActiveSupport::JSON::Encoding.time_precision setting to 6, ensuring accurate comparisons and functionality.

Computer stuff, Ruby

`hide_const`, the RSpec helper that I had never used before

The author shares their positive experience with test-driven development (TDD) after a few months, noting improvements in code quality and simplicity. They demonstrate how to effectively test optional dependencies in Ruby using RSpec’s hide_const helper, which simplifies testing by temporarily removing constants. The post concludes with reflections on writing shorter articles.