Sha256: 3cbcdd6aa4ae9d613d6765081a1fc747f7cb0788b0056e2f295712807f6bfede

Contents?: true

Size: 729 Bytes

Versions: 2

Compression:

Stored size: 729 Bytes

Contents

require 'spec_helper'
require 'graphml2json'

describe Graphml2Json do
  let(:json) {'{"nodes":[{"name":0},{"name":1},{"name":2},{"name":3}],"edges":[{"source":0,"target":1},{"source":1,"target":2},{"source":2,"target":3},{"source":3,"target":null}]}'}

  describe ".generate" do
    context "missing proper namespace" do
      it 'returns valid json' do
        graphml = File.read("spec/fixtures/graphml_without_namespacing.txt")
        Graphml2Json::generate(graphml).should == json
      end
    end

    context "with namespace" do
      it 'returns valid json' do
        graphml = File.read("spec/fixtures/graphml_with_namespacing.txt")
        Graphml2Json::generate(graphml).should == json
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
graphml2json-0.0.3 spec/graphml2json_spec.rb
graphml2json-0.0.2 spec/graphml2json_spec.rb