<commit_before># frozen_string_literal: true

require_relative '../helper'

describe Dalli::Protocol::ValueCompressor do
  describe 'options' do
    subject { Dalli::Protocol::ValueCompressor.new(options) }

    describe 'compress_by_default?' do
      describe 'when the compress option is unspecified' do
        let(:options) { {} }

        it 'defaults to true' do
          assert subject.compress_by_default?
        end

        describe 'when the deprecated compression option is used' do
          let(:options) { { compression: false } }

          it 'overrides the default' do
            refute subject.compress_by_default?
          end
        end
      end

      describe 'when the compress option is explicitly true' do
        let(:options) { { compress: true } }

        it 'is true' do
          assert subject.compress_by_default?
        end

        describe 'when the deprecated compression option is used' do
          let(:options) { { compress: true, compression: false } }

          it 'does not override the explicit compress options' do
            assert subject.compress_by_default?
          end
        end
      end

      describe 'when the compress option is explicitly false' do
        let(:options) { { compress: false } }

        it 'is false' do
          refute subject.compress_by_default?
        end

        describe 'when the deprecated compression option is used' do
          let(:options) { { compress: false, compression: true } }

          it 'does not override the explicit compress options' do
            refute subject.compress_by_default?
          end
        end
      end
    end<commit_msg>Make adjustments for latest rubocop-minitest (#904)<commit_after># frozen_string_literal: true

require_relative '../helper'

describe Dalli::Protocol::ValueCompressor do
  describe 'options' do
    subject { Dalli::Protocol::ValueCompressor.new(options) }

    describe 'compress_by_default?' do
      describe 'when the compress option is unspecified' do
        let(:options) { {} }

        it 'defaults to true' do
          assert_predicate subject, :compress_by_default?
        end

        describe 'when the deprecated compression option is used' do
          let(:options) { { compression: false } }

          it 'overrides the default' do
            refute_predicate subject, :compress_by_default?
          end
        end
      end

      describe 'when the compress option is explicitly true' do
        let(:options) { { compress: true } }

        it 'is true' do
          assert_predicate subject, :compress_by_default?
        end

        describe 'when the deprecated compression option is used' do
          let(:options) { { compress: true, compression: false } }

          it 'does not override the explicit compress options' do
            assert_predicate subject, :compress_by_default?
          end
        end
      end

      describe 'when the compress option is explicitly false' do
        let(:options) { { compress: false } }

        it 'is false' do
          refute_predicate subject, :compress_by_default?
        end

        describe 'when the deprecated compression option is used' do
          let(:options) { { compress: false, compression: true } }

          it 'does not override the explicit compress options' do
            refute_predicate subject, :compress_by_default?
          end
        end
      end
    end
{'fraction_non_alphanumeric': 0.07005253940455342, 'fraction_numerical': 0.0008756567425569177, 'mean_word_length': 2.2483412322274883, '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': '6187171', 'n_tokens_mistral': 886, 'n_tokens_neox': 839, 'n_words': 310}