<commit_before>require 'spec_helper'

include Electr

describe ElectrValue do

  it "holds a number" do
    result = ElectrValue.new(10)
    expect(result.number).to eq 10
  end

  it "has type number" do
    result = ElectrValue.new(10)
    expect(result.type).to eq :number
  end

  it "knows it is a number" do
    result = ElectrValue.new(10)
    expect(result.number?).to eq true
    expect(result.error?).to eq false
  end

  it "holds an error message" do
    result = ElectrValue.error("message")
    expect(result.error).to eq "message"
  end

  it "has type error" do
    result = ElectrValue.error("message")
    expect(result.type).to eq :error
  end

  it "knows it is a error" do
    result = ElectrValue.error("message")
    expect(result.error?).to eq true
    expect(result.number?).to eq false
  end

  describe "==" do
    it "is equal when all same members" do
      a = ElectrValue.new(10, :number, "foo")
      b = ElectrValue.new(10, :number, "foo")
      expect(a.object_id).not_to eq b.object_id
      expect(a).to eq b
    end

    it "isn't equal when different types" do
      a = ElectrValue.new(10, :number, "foo")
      b = ElectrValue.new(10, :error, "foo")
      expect(a).not_to eq b
    end

    it "isn't equal when different classes" do
      a = ElectrValue.new(10, :number, "foo")
      b = 10
      expect(a).not_to eq b
    end

  end

end
<commit_msg>Reword<commit_after>require 'spec_helper'

include Electr

describe ElectrValue do

  describe "number" do

    it "holds a number" do
      result = ElectrValue.new(10)
      expect(result.number).to eq 10
    end

    it "has type number" do
      result = ElectrValue.new(10)
      expect(result.type).to eq :number
    end

    it "knows it is a number" do
      result = ElectrValue.new(10)
      expect(result.number?).to eq true
      expect(result.error?).to eq false
    end
  end

  describe "error" do

    it "holds an error message" do
      result = ElectrValue.error("message")
      expect(result.error).to eq "message"
    end

    it "has type error" do
      result = ElectrValue.error("message")
      expect(result.type).to eq :error
    end

    it "knows it is a error" do
      result = ElectrValue.error("message")
      expect(result.error?).to eq true
      expect(result.number?).to eq false
    end
  end

  describe "==" do
    it "is equal when all same members" do
      a = ElectrValue.new(10, :number, "foo")
      b = ElectrValue.new(10, :number, "foo")
      expect(a.object_id).not_to eq b.object_id
      expect(a).to eq b
    end

    it "isn't equal when different types" do
      a = ElectrValue.new(10, :number, "foo")
      b = ElectrValue.new(10, :error, "foo")
      expect(a).not_to eq b
    end

    it "isn't equal when different classes" do
      a = ElectrValue.new(10, :number, "foo")
      b = 10
      expect(a).not_to eq b
    end

  end

end

{'fraction_non_alphanumeric': 0.11141868512110727, 'fraction_numerical': 0.01384083044982699, 'mean_word_length': 2.52991452991453, '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': '6118358', 'n_tokens_mistral': 1033, 'n_tokens_neox': 971, 'n_words': 302}