I have written multiple test cases in a file, and i want to run rake task in every test individually. When i run the test case with this command:
ruby -I test test/integration/my_test_file.rb
Then rake task runs only once. And many of my tests are failing. But if i run all failing test individually with this command
ruby -I test test/integration/my_test_file.rb -n test_name
Then all tests are passing.
The problem is rake task is running only once in first case. But for individual test Rake task runs every time for each test case.
here is how i setup rake task in my test file
require "rake"
MyAppName::Application.load_tasks
and in every test case i have this:
Rake::Task['tasks:my_task_name'].invoke
So how can i solve my problem ?