<commit_before>shared_examples 'black_box' do

  let(:klass) { Hash }

  let(:instance) { subject.instance }

  describe '.subject' do

    before { subject.subject klass }

    it 'should assign box_class' do
      expect(subject.box_class).to eq klass
    end

    context 'instance' do

      describe '#subject' do

        it 'should be an instance of subject' do
          expect(instance.subject).to be_a klass
        end

      end

    end

  end

  describe '.accept' do

    let(:attributes) { %i(red green blue) }

    before { subject.accept *attributes }

    it 'should push attributes to box_attributes' do
      expect(subject.box_attributes).to eq attributes
    end

    it 'should have accessors for attributes' do
      attributes.each do |attribute|
        expect(subject).to respond_to attribute
        expect(subject).to respond_to :"#{attribute}="
      end
    end

    context 'duplicate keys' do

      let(:attributes) { %i(red red green blue) }
<commit_msg>Made tests in black_box shared spec focusable (no longer depend on execution order)<commit_after>shared_examples 'black_box' do

  let(:klass) { Hash }

  let(:instance) { subject.instance }

  describe '.subject' do

    before do
      subject.subject klass
      subject.box_attributes.clear
      subject.box_methods.clear
    end

    it 'should assign box_class' do
      expect(subject.box_class).to eq klass
    end

    context 'instance' do

      describe '#subject' do

        it 'should be an instance of subject' do
          expect(instance.subject).to be_a klass
        end

      end

    end

  end

  describe '.accept' do

    let(:attributes) { %i(red green blue) }

    before do
      subject.subject klass
      subject.box_methods.clear
      subject.accept *attributes
    end

    it 'should push attributes to box_attributes' do
      expect(subject.box_attributes).to eq attributes
    end

    it 'should have accessors for attributes' do
      attributes.each do |attribute|
        expect(subject).to respond_to attribute
        expect(subject).to respond_to :"#{attribute}="
      end
    end

    context 'duplicate keys' do

      let(:attributes) { %i(red red green blue) }

{'fraction_non_alphanumeric': 0.08216068996822515, 'fraction_numerical': 0.0, 'mean_word_length': 2.537720706260032, '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': '394790', 'n_tokens_mistral': 642, 'n_tokens_neox': 612, 'n_words': 203}