<commit_before>require 'spec_helper'
require 'models/taxonomite/zoology'

module Taxonomite
    RSpec.describe Tree, type: :model do

        context 'model function' do
            let!(:node) { build(:taxonomite_node) }

            it 'instantiates a node' do
                expect(node.class.name).to eq("Taxonomite::Node")
            end

            it 'destroys a node' do
                expect { node.destroy }.not_to raise_error
            end

            it 'sets the name' do
                node.name = "new_name"
                expect(node.name).to eq("new_name")
            end

            it 'allow access to children' do
                expect { node.children }.not_to raise_error
            end

            it 'allow access to parent' do
                expect { node.parent }.not_to raise_error
            end

        end

    end
end<commit_msg>add spec for node == operators<commit_after>require 'spec_helper'
require 'models/taxonomite/zoology'

module Taxonomite
    RSpec.describe Tree, type: :model do

        context 'node function' do
            let!(:node) { build(:taxonomite_node) }

            it 'instantiates a node' do
                expect(node.class.name).to eq("Taxonomite::Node")
            end

            it 'destroys a node' do
                expect { node.destroy }.not_to raise_error
            end

            it 'sets the name' do
                node.name = "new_name"
                expect(node.name).to eq("new_name")
            end

            it 'allow access to children' do
                expect { node.children }.not_to raise_error
            end

            it 'allow access to parent' do
                expect { node.parent }.not_to raise_error
            end

            it 'has a working == operator' do
                node2 = build(:taxonomite_node)
                expect(node == node).to eq(true)
                expect(node == node2).to eq(false)
                expect(node != node2).to eq(true)
            end
        end

    end
end
{'fraction_non_alphanumeric': 0.08333333333333333, 'fraction_numerical': 0.0014792899408284023, 'mean_word_length': 1.4683698296836982, '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': '507808', 'n_tokens_mistral': 578, 'n_tokens_neox': 539, 'n_words': 161}