<commit_before>module Janus
  module TestHelper
    def self.included(klass)
      klass.class_eval do
        setup { @janus = Janus::Manager.new(request, cookies) }
      end
    end

    def sign_in(user, options = {})
      @janus.login(user, options)
    end

    def sign_out(user_or_scope = nil)
      if user_or_scope
        @janus.logout(Janus.scope_for(user_or_scope))
      else
        @janus.logout
      end
    end

    def assert_authenticated(scope)
      assert @janus.authenticated?(scope), "Expected #{scope} to be authenticated."
    end

    def assert_not_authenticated(scope)
      assert !@janus.authenticated?(scope), "Expected #{scope} to not be authenticated."
    end
  end
end<commit_msg>Update Janus::TestHelper<commit_after>module Janus
  module TestHelper
    attr_reader :janus

    def self.included(klass)
      klass.class_eval do
        setup { @janus = Janus::Manager.new(request, cookies) }
      end
    end

    def sign_in(user, options = {})
      janus.login(user, options)
    end

    def sign_out(user_or_scope = nil)
      if user_or_scope
        janus.logout(Janus.scope_for(user_or_scope))
      else
        janus.logout
      end
    end

    def assert_authenticated(scope)
      assert janus.authenticated?(scope), "Expected #{scope} to be authenticated."
    end

    def refute_authenticated(scope)
      refute janus.authenticated?(scope), "Expected #{scope} to not be authenticated."
    end

    alias_method :assert_not_authenticated, :refute_authenticated
  end
end
{'fraction_non_alphanumeric': 0.09019607843137255, 'fraction_numerical': 0.0, 'mean_word_length': 2.8759493670886074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4705309', 'n_tokens_mistral': 507, 'n_tokens_neox': 490, 'n_words': 111}