diff --git a/lib/noosfero_test.rb b/lib/noosfero_test.rb index d7958c2..6f5853c 100644 --- a/lib/noosfero_test.rb +++ b/lib/noosfero_test.rb @@ -8,5 +8,16 @@ module NoosferoTest super(path, (parameters ? self.class.extra_parameters.merge(parameters) : self.class.extra_parameters), headers) end + module ClassMethods + def noosfero_test(parameters) + instance_variable_set('@noosfero_test_extra_parameters', parameters) + def extra_parameters + @noosfero_test_extra_parameters + end + include NoosferoTest + end + end end + +Test::Unit::TestCase.send(:extend, NoosferoTest::ClassMethods) diff --git a/test/test_helper.rb b/test/test_helper.rb index d1d1122..7d2ecd6 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,6 +2,7 @@ ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' require 'mocha' +require 'noosfero_test' class Test::Unit::TestCase # Transactional fixtures accelerate your tests by wrapping each test method -- libgit2 0.21.2