<commit_before>require 'abstract_unit'

class ViewLoadPathsTest < ActionController::TestCase
  class TestController < ActionController::Base
    def self.controller_path() "test" end
    def rescue_action(e) raise end

    before_filter :add_view_path, :only => :hello_world_at_request_time

    def hello_world() end
    def hello_world_at_request_time() render(:action => 'hello_world') end

    private
      def add_view_path
        prepend_view_path "#{FIXTURE_LOAD_PATH}/override"
      end
  end

  class Test::SubController < ActionController::Base
    layout 'test/sub'
    def hello_world; render(:template => 'test/hello_world'); end
  end

  def setup
    # TestController.view_paths = nil

    @request  = ActionController::TestRequest.new
    @response = ActionController::TestResponse.new

    @controller = TestController.new
    # Following is needed in order to setup @controller.template object properly
    @controller.send :assign_shortcuts, @request, @response
    @controller.send :initialize_template_class, @response
<commit_msg>Test constant is not defined anymore<commit_after>require 'abstract_unit'

class ViewLoadPathsTest < ActionController::TestCase
  class TestController < ActionController::Base
    def self.controller_path() "test" end
    def rescue_action(e) raise end

    before_filter :add_view_path, :only => :hello_world_at_request_time

    def hello_world() end
    def hello_world_at_request_time() render(:action => 'hello_world') end

    private
      def add_view_path
        prepend_view_path "#{FIXTURE_LOAD_PATH}/override"
      end
  end

  module Test
    class SubController < ActionController::Base
      layout 'test/sub'
      def hello_world; render(:template => 'test/hello_world'); end
    end
  end

  def setup
    # TestController.view_paths = nil

    @request  = ActionController::TestRequest.new
    @response = ActionController::TestResponse.new

    @controller = TestController.new
    # Following is needed in order to setup @controller.template object properly
    @controller.send :assign_shortcuts, @request, @response
    @controller.send :initialize_template_class, @response

{'fraction_non_alphanumeric': 0.08259860788863109, 'fraction_numerical': 0.0, 'mean_word_length': 4.245742092457421, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4660190', 'n_tokens_mistral': 619, 'n_tokens_neox': 596, 'n_words': 154}