<commit_before><commit_msg>Add result test<commit_after>require 'spec_helper'

describe Verbal::Result do
  describe '#succeeded?' do
    it 'is true when the outcome is not :error' do
      result = described_class.new(outcome: :not_error, value: nil)

      expect(result).to be_succeeded
    end

    it 'is false when the outcome is :error' do
      result = described_class.new(outcome: :error, value: nil)

      expect(result).not_to be_succeeded
    end
  end

  describe '#failed?' do
    it 'is false when the outcome is not :error' do
      result = described_class.new(outcome: :not_error, value: nil)

      expect(result).not_to be_failed
    end

    it 'is true when the outcome is :error' do
      result = described_class.new(outcome: :error, value: nil)

      expect(result).to be_failed
    end
  end

  describe '#outcome' do
    it 'is simply the outcome' do
      result = described_class.new(outcome: :some_outcome, value: nil)

      expect(result.outcome).to eql(:some_outcome)
    end
  end

  describe '#value' do
    it 'is simply the value' do
      result = described_class.new(outcome: nil, value: :some_value)

      expect(result.value).to eql(:some_value)
    end
  end
end
{'fraction_non_alphanumeric': 0.09429280397022333, 'fraction_numerical': 0.0, 'mean_word_length': 3.1724137931034484, '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': '70786', 'n_tokens_mistral': 399, 'n_tokens_neox': 380, 'n_words': 122}