Last Updated: February 25, 2016
·
2.834K
· aespinosa

Mimic rspec’s “context” in minitest/spec

Original post in http://amespinosa.wordpress.com/2014/01/18/mimic-rspecs-context-in-minitestspec/

I like spec-style tests as you can describe the scenarios of a test in a more structured manner. However, I love the xUnit family’s assertion calls. Here’s a small helper to create the describe => context synonym:

def context(*args, &block)
  describe(*args, &block)
end

1 Response
Add your response

alias_method :context, :describe

over 1 year ago ·