<commit_before>require 'test_helper'



class SchemasTest < Test::Unit::TestCase
  include Spontaneous

  context "Configurable names" do
    setup do
      class FunkyContent < Content
      end
      class MoreFunkyContent < FunkyContent
      end
      class ABCDifficultName < Content
      end
    end
    should "1. default to generated version" do
      FunkyContent.default_name.should == "Funky Content"
      FunkyContent.name.should == "Funky Content"
      MoreFunkyContent.name.should == "More Funky Content"
      ABCDifficultName.default_name.should == "ABC Difficult Name"
      ABCDifficultName.name.should == "ABC Difficult Name"
    end

    should "2. be settable" do
      FunkyContent.name "Content Class"
      FunkyContent.name.should == "Content Class"
    end

    should "3. be settable using =" do
      FunkyContent.name = "Content Class"
      FunkyContent.name.should == "Content Class"
    end

    should "4. not inherit from superclass" do
      FunkyContent.name = "Custom Name"
      MoreFunkyContent.name.should == "More Funky Content"
    end
  end
end
<commit_msg>neater test<commit_after>require 'test_helper'



class SchemasTest < Test::Unit::TestCase
  include Spontaneous

  context "Configurable names" do
    setup do
      class FunkyContent < Content; end
      class MoreFunkyContent < FunkyContent; end
      class ABCDifficultName < Content; end

      class CustomName < ABCDifficultName
        name "Some Name"
      end
    end

    should "1. default to generated version" do
      FunkyContent.default_name.should == "Funky Content"
      FunkyContent.name.should == "Funky Content"
      MoreFunkyContent.name.should == "More Funky Content"
      ABCDifficultName.default_name.should == "ABC Difficult Name"
      ABCDifficultName.name.should == "ABC Difficult Name"
    end

    should "2. be settable" do
      CustomName.name.should == "Some Name"
      FunkyContent.name "Content Class"
      FunkyContent.name.should == "Content Class"
    end

    should "3. be settable using =" do
      FunkyContent.name = "Content Class"
      FunkyContent.name.should == "Content Class"
    end

    should "4. not inherit from superclass" do
      FunkyContent.name = "Custom Name"
      MoreFunkyContent.name.should == "More Funky Content"
    end
  end
end

{'fraction_non_alphanumeric': 0.08044982698961937, 'fraction_numerical': 0.0034602076124567475, 'mean_word_length': 2.855, 'pattern_counts': {'":': 0, '<': 12, '<?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': '7626283', 'n_tokens_mistral': 717, 'n_tokens_neox': 699, 'n_words': 199}