<commit_before>module SecurityMacros
  def self.included(klass)
    klass.class_eval do 
      extend  ClassMethods
      include InstanceMethods
    end
  end
  
  module InstanceMethods
    def subdomain(subdomain)
      @request.host = "#{subdomain}.#{HOST}"
    end
  end
  
  module ClassMethods
    def logged_in_as(person)
      context "logged in as #{person}" do
        setup do
          # Restful Auth's login_as test helper
          login_as person
        end
        
        yield
      end
    end
    
    def on_subdomain(sd)
      context "on subdomain #{sd}" do
        setup do
          subdomain sd
        end
    
        yield
      end
    end
    
    def not_logged_in
      context "not logged in" do
        setup do
          # Restful Auth's login_as test helper
          login_as nil
        end
    
        yield
      end<commit_msg>removed on_subdomain shoulda macro. Not general enough to be in blank<commit_after>module SecurityMacros
  def self.included(klass)
    klass.class_eval do 
      extend  ClassMethods
      include InstanceMethods
    end
  end
  
  module InstanceMethods
    def subdomain(subdomain)
      @request.host = "#{subdomain}.#{HOST}"
    end
  end
  
  module ClassMethods
    def logged_in_as(person)
      context "logged in as #{person}" do
        setup do
          # Restful Auth's login_as test helper
          login_as person
        end
        
        yield
      end
    end
    
    def not_logged_in
      context "not logged in" do
        setup do
          # Restful Auth's login_as test helper
          login_as nil
        end
    
        yield
      end
{'fraction_non_alphanumeric': 0.046200607902735565, 'fraction_numerical': 0.0, 'mean_word_length': 1.6677471636952999, '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': '7574590', 'n_tokens_mistral': 474, 'n_tokens_neox': 476, 'n_words': 148}