1. 4

  2. 3

    Why use closures instead of passing module name as an argument? IMHO that would be much clearer and much faster than the closures approach.

    1. 1

      This is basically how Mox works under the hood.

      1. 1

        It seems like your goals here are more exploratory than practical. Please correct me if I’m wrong.

        On the practical side: in the last year or two, I’d been searching for a more practical way to allow occasional dependency injection for testing purposes. I didn’t like using Mock or Mox much at all. Then a teammate introduced me to Mimic, and mocking no longer bothers me at all. Great tool. https://github.com/edgurgel/mimic

        1. 1

          Oh, mimic creates an alias to the module with an overloaded name. that kinda gives me the heebie jeebies, can’t quite put my finger on why though.