In RSpec I could create helper modules in /spec/support/...
module MyHelpers
def help1
puts \"hi\"
end
end
and include it
One thing I will do is create my own Test
class inheriting from Minitest::Test
. This allows me to do any sort of configuration on my base test class and keeping it isolated to my own project1.
# test_helper.rb
include 'helpers/my_useful_module'
module MyGem
class Test < Minitest::Test
include MyUsefulModule
end
end
# my_test.rb
include 'test_helper'
module MyGem
MyTest < Test
end
end
1 This is most likely unneeded, but I like keeping all my gem code isolated.