Sha256: 8a6ed84194042ac285d6b6baaa1e82e2d40f91a66975b2ebee20f2a69bf049c4

Contents?: true

Size: 752 Bytes

Versions: 3

Compression:

Stored size: 752 Bytes

Contents

require 'spec_helper'
require 'analyst'

describe Society::ObjectGraph do

  let(:graph) { Struct.new(:nodes, :edges)}
  let(:node) { Struct.new(:full_name) }
  let(:edge) { Struct.new(:from, :to) }

  let(:node_instance_1) { node.new("sample_node")}
  let(:node_instance_2) { node.new("other_node")}
  let(:edge_instance) { edge.new(node_instance_1, node_instance_2) }

  let(:graph) { Society::ObjectGraph.new(
      nodes: [node_instance_1, node_instance_2],
      edges: [edge_instance]
    )
  }

  describe "#initialize" do
    it "initializes its nodes" do
      expect(graph.nodes.first.full_name).to eq "sample_node"
    end
    it "initializes its edges"  do
      expect(graph.edges.first.to.full_name).to eq "other_node"
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
society-1.1.1 spec/object_graph_spec.rb
society-1.1.0 spec/object_graph_spec.rb
society-1.0.0 spec/object_graph_spec.rb