require_relative '../../lib/rgraph/node' describe Node do subject { Node.new(name: "Lucas", id: '1', age: 20) } describe "#new" do its(:name) { should eq "Lucas" } its(:id) { should eq '1' } its(:age) { should eq 20 } end describe "#degree" do its(:degree) { should eq 0} end describe "#has_neighbour" do it "recognizes its neighbour" do n1 = Node.new(id: 1) n2 = Node.new(id: 1) n1.neighbours << n2 expect(n1.has_neighbour?(n2)).to be_true end end end