I created a plugin for a OS Rails Project. The plugin makes the tests fails, in order to preserve the system consistency, i would like to override the app tests which fails once the behavior of my plugin is applied.
I have created patches to modify the methods of some existing classes through patches in Class and Instance methods, and I thought i could make the same with tests, but unfortunately i don't get access to the app tests in a plugin.
When i tried to access the TestClass, i get the following error:
cannot remove Object::DEFAULT_OPTIONS
...source/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:603:in `remove_const'
...source/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:603:in `remove_constant'
...source/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:603:in `instance_eval'
...source/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:603:in `remove_constant'
...source/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:549:in `new_constants_in'
...source/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:549:in `each'
...source/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:549:in `new_constants_in'
...source/trunk/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
I read about Dependencies.load_paths, but i hadn't success on this way.
test_path = Rails.root.join('test', 'unit')
$LOAD_PATH << test_path
ActiveSupport::Dependencies.load_paths << test_path
require 'project_test'
Any idea whether it could be possibly on any way or not.