RubyFlow The Ruby and Rails community linklog


The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!


Ever wanted to modify an ENV variable, an instance or class variable (e.g. on Config) for the duration of a block or for all tests of a “describe” group? This pattern emerged repeatedly in my suites and as I don’t like to bloat my test/spec helper, about time for the lightweight and dependency-free minitest-substitute gem. Drop cumbersome before and after handling with one or more easy to read with "ENV['FOO']", "bar" or with "@run_at", on: Config { } declarations. Happy testing!

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in