Closed drnic closed 3 years ago
Hello @drnic, thanks for testing out prosopite!
In the README section for tests, the following is mentioned:
# spec/spec_helper.rb
config.before do
Prosopite.scan
end
config.after do
Prosopite.finish
end
config.before
and config.after
in Rspec mean before(:each)
and not before(:suite)
.
I should probably make it more explicit in README.
In your minitest case, i guess that you run Prosopite.scan
once before all tests and Prosopite.finish
once after all tests.
You can try to run scan/finish before and after each test. This will probably work.
Ahh, when I saw "And each test can be scanned with:" I thought it was optional.
I'm using minitest and the following looks to make the above test stop failing:
# test/test_helper.rb
module ProsopiteTesting
def before_setup
super
Prosopite.scan
end
def after_teardown
Prosopite.finish
super
end
end
class MiniTest::Unit::TestCase
include ProsopiteTesting
end
Minitest solution based on suggestion in https://stackoverflow.com/questions/16118086/how-to-run-code-before-each-test-case-in-all-tests-in-minitest/16118387
I added prosopite, turned on test exceptions, and watched 43 of my tests explode. Cool. Except when I look at the errors, I'm struggling to figure out what is the issue.
One error complains about a rails fixture finder method:
institution_test.rb:33 is:
What is the issue being raised here and what's the fix?