Sha256: 076baad588c773dc9731b8f8ab88a4a69744ca667b67817eb80bd592cd9bcd57

Contents?: true

Size: 1002 Bytes

Versions: 25

Compression:

Stored size: 1002 Bytes

Contents

require 'spec_helper'

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

  describe '#as_var' do
    it 'should set the variable to the correct node' do
      vars = Set[]
      route = graph.v.as_var(: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_var(: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_var(:who)
      r = r1.in_e(:wrote).as_var(:wrote).out_v.as_var(: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

25 entries across 25 versions & 1 rubygems

Version Path
pacer-2.0.24-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.22-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.20-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.19-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.18-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.17-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.16-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.15-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.14-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.13-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.12-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.10-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.10.pre-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.8-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.6-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.4.pre-java spec/pacer/side_effect/as_var_spec.rb
pacer-2.0.0.pre-java spec/pacer/side_effect/as_var_spec.rb
pacer-1.6.0-java spec/pacer/side_effect/as_var_spec.rb
pacer-1.5.4-java spec/pacer/side_effect/as_var_spec.rb
pacer-1.5.3-java spec/pacer/side_effect/as_var_spec.rb