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
Written by Allan Espinosa
Related protips
1 Response
alias_method :context, :describe
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#