<commit_before>require 'std/option'

describe Moon::Option do
  context '#initialize' do
    it 'should initialize with a value' do
      my_value = 'Hello World :3'
      opt = Moon::Option.new(my_value)
      expect(opt.value).to eq(my_value)
    end
  end

  context '#map' do
    it 'should eval and replace if it has a non-blank value' do
      my_value = 'Hello World :3'
      opt = Moon::Option.new(my_value)
      opt.map { |v| v.reverse }
      expect(opt.value).to eq(my_value.reverse)
    end

    it 'should not replace, if it has a blank value' do
      opt = Moon::Option.new(nil)
      opt.map { |v| 'Egg' }
      expect(opt.value).to eq(nil)
    end
  end

  context '#blank?' do
    it 'should report blank if the value is nil' do
      opt = Moon::Option.new(nil)
      expect(opt.blank?).to eq(true)
    end

    it 'should report non-blank if the value is anything except nil' do
      opt = Moon::Option.new(false)
      expect(opt.blank?).to eq(false)
    end
  end

  context '#presence' do
    it 'should return nil if blank' do
      opt = Moon::Option.new(nil)
      expect(opt.presence).to eq(nil)
    end

    it 'should return value if non-blank' do
      opt = Moon::Option.new(false)
      expect(opt.presence).to eq(false)
    end
  end
end<commit_msg>Updated option spec with described_class<commit_after>require 'std/option'

describe Moon::Option do
  context '#initialize' do
    it 'should initialize with a value' do
      my_value = 'Hello World :3'
      opt = described_class.new(my_value)
      expect(opt.value).to eq(my_value)
    end
  end

  context '#map' do
    it 'should eval and replace if it has a non-blank value' do
      my_value = 'Hello World :3'
      opt = described_class.new(my_value)
      opt.map { |v| v.reverse }
      expect(opt.value).to eq(my_value.reverse)
    end

    it 'should not replace, if it has a blank value' do
      opt = described_class.new(nil)
      opt.map { |v| 'Egg' }
      expect(opt.value).to be_nil
    end
  end

  context '#blank?' do
    it 'should report blank if the value is nil' do
      opt = described_class.new(nil)
      expect(opt).to be_blank
    end

    it 'should report non-blank if the value is anything except nil' do
      opt = described_class.new(false)
      expect(opt.blank?).to eq(false)
    end
  end

  context '#presence' do
    it 'should return nil if blank' do
      opt = described_class.new(nil)
      expect(opt.presence).to be_nil
    end

    it 'should return value if non-blank' do
      opt = described_class.new(false)
      expect(opt.presence).to eq(false)
    end
  end
end
{'fraction_non_alphanumeric': 0.10425450364124185, 'fraction_numerical': 0.0015331544653123803, 'mean_word_length': 2.555858310626703, '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': '7573311', 'n_tokens_mistral': 867, 'n_tokens_neox': 849, 'n_words': 277}