Sha256: 6f124299dfb64e74c7feb8c56a7cb0b33196a632d74d61d5f303590e094ed728

Contents?: true

Size: 978 Bytes

Versions: 10

Compression:

Stored size: 978 Bytes

Contents

require 'spec_helper'

Run.all(:read_only) do
  use_pacer_graphml_data(:read_only)

  describe '#as' do
    it 'should set the variable to the correct node' do
      vars = Set[]
      route = graph.v.as(:a_vertex)
      route.in_e(:wrote) { |edge| vars << route.vars[:a_vertex] }.count
      vars.should == Set[*graph.e.e(:wrote).in_v]
    end

    it 'should not break path generation (simple)' do
      who = nil
      r1 = graph.v.as(:who)
      r = r1.in_e(:wrote).out_v.v { |v|
        who = r1.vars[:who]
      }.paths
      r.each do |path|
        path.to_a[0].should == who
        path.length.should == 3
      end
    end

    it 'should not break path generation' do
      who_wrote_what = nil
      r1 = graph.v.as(:who)
      r = r1.in_e(:wrote).as(:wrote).out_v.as(:what).v { |v|
        who_wrote_what = [r1.vars[:who], r1.vars[:wrote], r1.vars[:what]]
      }.paths
      r.each do |path|
        path.to_a.should == who_wrote_what
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pacer-1.3.5-java spec/pacer/side_effect/as_spec.rb
pacer-1.3.4-java spec/pacer/side_effect/as_spec.rb
pacer-1.3.3-java spec/pacer/side_effect/as_spec.rb
pacer-1.3.2-java spec/pacer/side_effect/as_spec.rb
pacer-1.3.1-java spec/pacer/side_effect/as_spec.rb
pacer-1.2.0-java spec/pacer/side_effect/as_spec.rb
pacer-1.1.1-java spec/pacer/side_effect/as_spec.rb
pacer-1.1.0-java spec/pacer/side_effect/as_spec.rb
pacer-1.0.3-java spec/pacer/side_effect/as_spec.rb
pacer-1.0.2-java spec/pacer/side_effect/as_spec.rb