Commit 1ea6b1cb807a4187b8320724e026cc8edce68ddc
1 parent
5281ccda
Exists in
master
and in
20 other branches
rails4: change require on tests
Use these two commands inside vim: :!ag -l '..\/..\/..\/..\/test' | xargs perl -pi -E "s/require.*test_helper.*/require 'test_helper'/g" :!ag -l "require File.*'/" | xargs perl -pi -E "s/require File.*'\//require_relative '/g":e ""'"
Showing
152 changed files
with
193 additions
and
193 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 152 files displayed.
lib/tasks/ci.rake
@@ -44,7 +44,7 @@ namespace :ci do | @@ -44,7 +44,7 @@ namespace :ci do | ||
44 | end | 44 | end |
45 | puts | 45 | puts |
46 | 46 | ||
47 | - sh 'testrb', '-Itest', *tests unless tests.empty? | 47 | + sh 'ruby', '-Itest', *tests unless tests.empty? |
48 | sh 'cucumber', *features unless features.empty? | 48 | sh 'cucumber', *features unless features.empty? |
49 | sh 'xvfb-run', 'cucumber', '-p', 'selenium', *features unless features.empty? | 49 | sh 'xvfb-run', 'cucumber', '-p', 'selenium', *features unless features.empty? |
50 | 50 |
lib/tasks/plugins_tests.rake
@@ -107,12 +107,12 @@ def run_test(name, files) | @@ -107,12 +107,12 @@ def run_test(name, files) | ||
107 | if name == :cucumber || name == :selenium | 107 | if name == :cucumber || name == :selenium |
108 | run_cucumber task2profile(name, plugin), files | 108 | run_cucumber task2profile(name, plugin), files |
109 | else | 109 | else |
110 | - run_testrb files | 110 | + run_minitest files |
111 | end | 111 | end |
112 | end | 112 | end |
113 | 113 | ||
114 | -def run_testrb(files) | ||
115 | - sh 'testrb', '-I.:test', *files | 114 | +def run_minitest files |
115 | + sh 'ruby', '-Itest', *files | ||
116 | end | 116 | end |
117 | 117 | ||
118 | def run_cucumber(profile, files) | 118 | def run_cucumber(profile, files) |
plugins/breadcrumbs/test/functional/profile_design_controller_test.rb
plugins/breadcrumbs/test/test_helper.rb
plugins/breadcrumbs/test/unit/breadcrumbs_plugin_test.rb
plugins/breadcrumbs/test/unit/content_breadcrumbs_block_test.rb
plugins/bsc/test/functional/bsc_plugin_admin_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/bsc_plugin_admin_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/bsc_plugin_admin_controller' | ||
3 | 3 | ||
4 | class BscPluginAdminControllerTest < ActionController::TestCase | 4 | class BscPluginAdminControllerTest < ActionController::TestCase |
5 | 5 |
plugins/bsc/test/functional/bsc_plugin_myprofile_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/bsc_plugin_myprofile_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/bsc_plugin_myprofile_controller' | ||
3 | 3 | ||
4 | class BscPluginMyprofileControllerTest < ActionController::TestCase | 4 | class BscPluginMyprofileControllerTest < ActionController::TestCase |
5 | 5 |
plugins/bsc/test/unit/bsc_plugin/associate_enterprise_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../../test/test_helper' | 1 | +require 'test_helper' |
2 | 2 | ||
3 | class BscPlugin::AssociateEnterpriseTest < ActiveSupport::TestCase | 3 | class BscPlugin::AssociateEnterpriseTest < ActiveSupport::TestCase |
4 | VALID_CNPJ = '94.132.024/0001-48' | 4 | VALID_CNPJ = '94.132.024/0001-48' |
plugins/bsc/test/unit/bsc_plugin/bsc_test.rb
plugins/bsc/test/unit/bsc_plugin/contract_test.rb
plugins/bsc/test/unit/bsc_plugin/sale_test.rb
plugins/bsc/test/unit/bsc_plugin_test.rb
plugins/bsc/test/unit/ext/enterprise_test.rb
plugins/bsc/test/unit/ext/product_test.rb
plugins/classify_members/test/functional/classify_members_plugin_test.rb
plugins/classify_members/test/unit/classify_members_plugin_test.rb
plugins/comment_group/test/functional/comment_group_plugin_profile_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/profile/comment_group_plugin_profile_controller' | 1 | +require_relative '../test_helper' |
2 | +require_relative '../../controllers/profile/comment_group_plugin_profile_controller' | ||
3 | 3 | ||
4 | class CommentGroupPluginProfileControllerTest < ActionController::TestCase | 4 | class CommentGroupPluginProfileControllerTest < ActionController::TestCase |
5 | 5 |
plugins/comment_group/test/functional/comment_group_plugin_public_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/public/comment_group_plugin_public_controller' | 1 | +require_relative '../test_helper' |
2 | +require_relative '../../controllers/public/comment_group_plugin_public_controller' | ||
3 | 3 | ||
4 | class CommentGroupPluginPublicControllerTest < ActionController::TestCase | 4 | class CommentGroupPluginPublicControllerTest < ActionController::TestCase |
5 | 5 |
plugins/comment_group/test/functional/content_viewer_controller_test.rb
plugins/comment_group/test/test_helper.rb
plugins/comment_group/test/unit/allow_comment_test.rb
plugins/comment_group/test/unit/article_test.rb
plugins/comment_group/test/unit/comment_group_plugin_test.rb
plugins/comment_group/test/unit/comment_test.rb
plugins/community_block/test/functional/commmunity_block_plugin_profile_controller_test.rb
plugins/community_block/test/test_helper.rb
plugins/community_block/test/unit/commmunity_block_plugin_test.rb
plugins/community_block/test/unit/commmunity_block_test.rb
plugins/community_track/test/test_helper.rb
1 | -require_relative '../../../test/test_helper' | 1 | +require 'test_helper' |
2 | 2 | ||
3 | def create_track(name, profile) | 3 | def create_track(name, profile) |
4 | track = CommunityTrackPlugin::Track.new(:abstract => 'abstract', :body => 'body', :name => name, :profile => profile) | 4 | track = CommunityTrackPlugin::Track.new(:abstract => 'abstract', :body => 'body', :name => name, :profile => profile) |
plugins/custom_forms/test/functional/custom_forms_plugin_myprofile_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/custom_forms_plugin_myprofile_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/custom_forms_plugin_myprofile_controller' | ||
3 | 3 | ||
4 | class CustomFormsPluginMyprofileControllerTest < ActionController::TestCase | 4 | class CustomFormsPluginMyprofileControllerTest < ActionController::TestCase |
5 | def setup | 5 | def setup |
plugins/custom_forms/test/functional/custom_forms_plugin_profile_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/custom_forms_plugin_profile_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/custom_forms_plugin_profile_controller' | ||
3 | 3 | ||
4 | class CustomFormsPluginProfileControllerTest < ActionController::TestCase | 4 | class CustomFormsPluginProfileControllerTest < ActionController::TestCase |
5 | def setup | 5 | def setup |
plugins/custom_forms/test/unit/custom_forms_plugin/admission_survey_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../../test/test_helper' | 1 | +require 'test_helper' |
2 | 2 | ||
3 | class CustomFormsPlugin::AdmissionSurveyTest < ActiveSupport::TestCase | 3 | class CustomFormsPlugin::AdmissionSurveyTest < ActiveSupport::TestCase |
4 | should 'add member to community on perform' do | 4 | should 'add member to community on perform' do |
plugins/custom_forms/test/unit/custom_forms_plugin/answer_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../../test/test_helper' | 1 | +require 'test_helper' |
2 | 2 | ||
3 | class CustomFormsPlugin::AnswerTest < ActiveSupport::TestCase | 3 | class CustomFormsPlugin::AnswerTest < ActiveSupport::TestCase |
4 | should 'validates presence of field' do | 4 | should 'validates presence of field' do |
plugins/custom_forms/test/unit/custom_forms_plugin/field_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../../test/test_helper' | 1 | +require 'test_helper' |
2 | 2 | ||
3 | class CustomFormsPlugin::FieldTest < ActiveSupport::TestCase | 3 | class CustomFormsPlugin::FieldTest < ActiveSupport::TestCase |
4 | should 'set slug before validation based on name' do | 4 | should 'set slug before validation based on name' do |
plugins/custom_forms/test/unit/custom_forms_plugin/form_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../../test/test_helper' | 1 | +require 'test_helper' |
2 | 2 | ||
3 | class CustomFormsPlugin::FormTest < ActiveSupport::TestCase | 3 | class CustomFormsPlugin::FormTest < ActiveSupport::TestCase |
4 | should 'validates presence of a profile and a name' do | 4 | should 'validates presence of a profile and a name' do |
plugins/custom_forms/test/unit/custom_forms_plugin/membership_survey_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../../test/test_helper' | 1 | +require 'test_helper' |
2 | 2 | ||
3 | class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase | 3 | class CustomFormsPlugin::MembershipSurveyTest < ActiveSupport::TestCase |
4 | should 'validates presence of form_id' do | 4 | should 'validates presence of form_id' do |
plugins/custom_forms/test/unit/custom_forms_plugin/select_field_test.rb
plugins/custom_forms/test/unit/custom_forms_plugin/submission_test.rb
plugins/custom_forms/test/unit/ext/role_assingment_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../../test/test_helper' | 1 | +require 'test_helper' |
2 | 2 | ||
3 | class RoleAssignmentsTest < ActiveSupport::TestCase | 3 | class RoleAssignmentsTest < ActiveSupport::TestCase |
4 | should 'create membership_surveys on membership creation' do | 4 | should 'create membership_surveys on membership creation' do |
plugins/display_content/controllers/display_content_plugin_admin_controller.rb
plugins/display_content/controllers/display_content_plugin_myprofile_controller.rb
plugins/display_content/test/functional/display_content_plugin_admin_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/display_content_plugin_admin_controller' | 1 | +require_relative '../test_helper' |
2 | +require_relative '../../controllers/display_content_plugin_admin_controller' | ||
3 | 3 | ||
4 | class DisplayContentPluginAdminControllerTest < ActionController::TestCase | 4 | class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
5 | 5 |
plugins/display_content/test/functional/display_content_plugin_myprofile_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/display_content_plugin_myprofile_controller' | 1 | +require_relative '../test_helper' |
2 | +require_relative '../../controllers/display_content_plugin_myprofile_controller' | ||
3 | 3 | ||
4 | class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase | 4 | class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
5 | 5 |
plugins/display_content/test/unit/display_content_block_test.rb
1 | -require File.dirname(__FILE__) + '/../test_helper' | 1 | +require_relative '../test_helper' |
2 | class DisplayContentBlockTest < ActiveSupport::TestCase | 2 | class DisplayContentBlockTest < ActiveSupport::TestCase |
3 | 3 | ||
4 | INVALID_KIND_OF_ARTICLE = [EnterpriseHomepage, Event, RssFeed, UploadedFile, Gallery] | 4 | INVALID_KIND_OF_ARTICLE = [EnterpriseHomepage, Event, RssFeed, UploadedFile, Gallery] |
plugins/display_content/test/unit/display_content_plugin_test.rb
plugins/event/test/functional/event_block_test.rb
plugins/foo/test/unit/foo_plugin_test.rb
plugins/google_analytics/test/unit/google_analytics_plugin_test.rb
plugins/google_cse/test/functional/google_cse_plugin_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/google_cse_plugin_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/google_cse_plugin_controller' | ||
3 | 3 | ||
4 | class GoogleCsePluginControllerTest < ActionController::TestCase | 4 | class GoogleCsePluginControllerTest < ActionController::TestCase |
5 | 5 |
plugins/google_cse/test/unit/google_cse_plugin_test.rb
plugins/html5_video/test/functional/content_viewer_controler_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | 1 | +require 'test_helper' |
2 | require 'content_viewer_controller' | 2 | require 'content_viewer_controller' |
3 | 3 | ||
4 | class ContentViewerControllerTest < ActionController::TestCase | 4 | class ContentViewerControllerTest < ActionController::TestCase |
plugins/ldap/lib/ldap_plugin.rb
plugins/ldap/test/functional/account_controller_plugin_test.rb
plugins/ldap/test/functional/ldap_plugin_admin_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/ldap_plugin_admin_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/ldap_plugin_admin_controller' | ||
3 | 3 | ||
4 | class LdapPluginAdminControllerTest < ActionController::TestCase | 4 | class LdapPluginAdminControllerTest < ActionController::TestCase |
5 | 5 |
plugins/ldap/test/test_helper.rb
plugins/ldap/test/unit/ext/environment_test.rb
plugins/ldap/test/unit/ldap_authentication_test.rb
plugins/ldap/test/unit/ldap_plugin_test.rb
plugins/mark_comment_as_read/test/functional/mark_comment_as_read_plugin_profile_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/mark_comment_as_read_plugin_profile_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/mark_comment_as_read_plugin_profile_controller' | ||
3 | 3 | ||
4 | class MarkCommentAsReadPluginProfileControllerTest < ActionController::TestCase | 4 | class MarkCommentAsReadPluginProfileControllerTest < ActionController::TestCase |
5 | def setup | 5 | def setup |
plugins/mark_comment_as_read/test/unit/mark_comment_as_read_plugin/comment_test.rb
plugins/mark_comment_as_read/test/unit/mark_comment_as_read_test.rb
plugins/oauth_client/test/functional/oauth_client_plugin_public_controller_test.rb
plugins/oauth_client/test/test_helper.rb
plugins/oauth_client/test/unit/environment_test.rb
plugins/oauth_client/test/unit/oauth_client_plugin_test.rb
plugins/oauth_client/test/unit/user_test.rb
plugins/people_block/test/functional/people_block_plugin_environment_design_controller_test.rb
plugins/people_block/test/functional/people_block_plugin_profile_design_controller_test.rb
plugins/people_block/test/functional/profile_controller_test.rb
plugins/people_block/test/test_helper.rb
plugins/people_block/test/unit/members_block_test.rb
plugins/people_block/test/unit/people_block_plugin_test.rb
plugins/people_block/test/unit/people_block_test.rb
plugins/piwik/test/functional/piwik_plugin_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/piwik_plugin_admin_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/piwik_plugin_admin_controller' | ||
3 | 3 | ||
4 | class PiwikPluginAdminControllerTest < ActionController::TestCase | 4 | class PiwikPluginAdminControllerTest < ActionController::TestCase |
5 | 5 |
plugins/piwik/test/unit/piwik_plugin_test.rb
plugins/profile_description_block/test/unit/profile_description_block_test.rb
plugins/profile_members_headlines/test/test_helper.rb
plugins/recent_content/test/test_helper.rb
plugins/recent_content/test/unit/recent_content_block_test.rb
1 | -require File.dirname(__FILE__) + '/../test_helper' | 1 | +require_relative '../test_helper' |
2 | class RecentContentBlockTest < ActiveSupport::TestCase | 2 | class RecentContentBlockTest < ActiveSupport::TestCase |
3 | 3 | ||
4 | INVALID_KIND_OF_ARTICLE = [EnterpriseHomepage, RssFeed, UploadedFile, Gallery, Folder, Blog, Forum] | 4 | INVALID_KIND_OF_ARTICLE = [EnterpriseHomepage, RssFeed, UploadedFile, Gallery, Folder, Blog, Forum] |
plugins/relevant_content/test/test_helper.rb
plugins/relevant_content/test/unit/article.rb
plugins/relevant_content/test/unit/relevant_content_block_test.rb
plugins/relevant_content/test/unit/relevant_content_plugin_test.rb
plugins/remote_user/test/functional/remote_user_plugin_test.rb
plugins/require_auth_to_comment/test/unit/require_auth_to_comment_plugin_test.rb
plugins/send_email/test/functional/send_email_plugin_admin_controller_test.rb
plugins/send_email/test/functional/send_email_plugin_base_controller_test.rb
plugins/send_email/test/unit/send_email_plugin_mail_test.rb
plugins/send_email/test/unit/send_email_plugin_sender_test.rb
plugins/send_email/test/unit/send_email_plugin_test.rb
plugins/shopping_cart/test/functional/shopping_cart_plugin_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/shopping_cart_plugin_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/shopping_cart_plugin_controller' | ||
3 | 3 | ||
4 | class ShoppingCartPluginControllerTest < ActionController::TestCase | 4 | class ShoppingCartPluginControllerTest < ActionController::TestCase |
5 | 5 |
plugins/shopping_cart/test/functional/shopping_cart_plugin_myprofile_controller_test.rb
plugins/shopping_cart/test/unit/shopping_cart_plugin/cart_helper_test.rb
plugins/shopping_cart/test/unit/shopping_cart_plugin_test.rb
plugins/sniffer/test/integration/sniffer_map_test.rb
plugins/sniffer/test/unit/ext/product_category_test.rb
plugins/sniffer/test/unit/sniffer_plugin_profile_test.rb
plugins/social_share_privacy/test/functional/content_viewer_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../../../app/controllers/public/invite_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../../../app/controllers/public/invite_controller' | ||
3 | 3 | ||
4 | class ContentViewerControllerTest < ActionController::TestCase | 4 | class ContentViewerControllerTest < ActionController::TestCase |
5 | 5 |
plugins/social_share_privacy/test/functional/social_share_privacy_plugin_admin_controller_test.rb
1 | -require File.dirname(__FILE__) + '/../../../../test/test_helper' | ||
2 | -require File.dirname(__FILE__) + '/../../controllers/social_share_privacy_plugin_admin_controller' | 1 | +require 'test_helper' |
2 | +require_relative '../../controllers/social_share_privacy_plugin_admin_controller' | ||
3 | 3 | ||
4 | class SocialSharePrivacyPluginAdminControllerTest < ActionController::TestCase | 4 | class SocialSharePrivacyPluginAdminControllerTest < ActionController::TestCase |
5 | 5 |