<commit_before>require 'spec_helper'

describe Graph do

  describe 'Graph' do

    describe 'new' do

      it "should create a new graph with a name and no nodes" do
        graph1 = Graph::Graph.new('graph1')
        graph1.name.should eq('graph1')
        graph1.nodes.empty?.should eq(true)
      end

    end

    describe 'add' do

      it "should add a node to the graph with the given value" do
        graph1 = Graph::Graph.new('graph1')
        graph1.nodes.empty?.should eq(true)
        graph1.add(11)
        graph1.nodes.empty?.should eq(false)
        graph1.nodes[0].value.should eq(11)
      end

    end

  end

  describe 'Node' do

    describe 'new' do

      it "should create a new node with the given value and no incoming or outgoing nodes" do
        node1 = Graph::Node.new(11)<commit_msg>Add two new specs for the add_node method that hasn't yet been implemented.<commit_after>require 'spec_helper'

describe Graph do

  describe 'Graph' do

    describe 'new' do

      it "should create a new graph with a name and no nodes" do
        graph1 = Graph::Graph.new('graph1')
        graph1.name.should eq('graph1')
        graph1.nodes.empty?.should eq(true)
      end

    end

    describe 'add' do

      it "should add a node to the graph with the given value" do
        graph1 = Graph::Graph.new('graph1')
        graph1.nodes.empty?.should eq(true)
        graph1.add(11)
        graph1.nodes.empty?.should eq(false)
        graph1.nodes[0].value.should eq(11)
      end

    end

    describe 'add_node' do

      it "should be able to add a single Node object to the graph" do
        graph1 = Graph::Graph.new('graph1')
        node1 = Graph::Node.new(5)
        graph1.nodes.empty?.should eq(true)
        graph1.add_node(node1)
        graph1.nodes.length.should eq(1)
        graph1.nodes.include?(node1).should eq(true)
      end

      it "should be able to add multiple Node objects to the graph" do
        graph1 = Graph::Graph.new('graph1')
        node1 = Graph::Node.new(2)
        node2 = Graph::Node.new(11)
        node3 = Graph::Node.new(5)
        graph1.nodes.empty?should eq(true)
        graph1.add_node(node1)
        graph1.nodes.length.should eq(1)
        graph1.add_node(node2)
        graph1.nodes.length.should eq(2)
        graph1.nodes.include?(node1).should eq(true)
        graph1.nodes.include?(node2).should eq(true)
        graph1.nodes.include?(node3).should eq(false)
      end

    end

  end

  describe 'Node' do

    describe 'new' do

      it "should create a new node with the given value and no incoming or outgoing nodes" do
        node1 = Graph::Node.new(11)
{'fraction_non_alphanumeric': 0.10177828225501324, 'fraction_numerical': 0.027620128641695045, 'mean_word_length': 2.3426042983565107, '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': '2440321', 'n_tokens_mistral': 852, 'n_tokens_neox': 815, 'n_words': 247}