Sha256: c322dbc40269b87bc2de7054fac8403bfbf7810f46bd603b18e0637fa203421e

Contents?: true

Size: 1.99 KB

Versions: 25

Compression:

Stored size: 1.99 KB

Contents

require 'spec_helper'

# edge filters are also tested in filters_spec
module Pacer::Filter::PropertyFilter
  Run.tg do
    describe EdgeFilters do
      subject { filters }

      context 'symbol label' do
        let(:filters) { Pacer::Route.edge_filters graph, [:label] }

        its(:any?) { should be_true }
        its(:labels) { should == ['label'] }
        its(:extensions_only?) { should be_false }
        its(:extensions) { should be_empty }
        its(:route_modules) { should be_empty }
        its(:wrapper) { should be_nil }
        its(:blocks) { should be_empty }
        its(:properties) { should be_empty }
      end

      context 'symbol labels' do
        let(:filters) { Pacer::Route.edge_filters graph, [:label, :label2] }

        its(:any?) { should be_true }
        its(:labels) { should == ['label', 'label2'] }
      end

      context 'labels arrays' do
        let(:filters) { Pacer::Route.edge_filters graph, ["label", [:label2]] }

        its(:any?) { should be_true }
        its(:labels) { should == ['label', 'label2'] }
      end

      context 'labels and properties' do
        let(:filters) { Pacer::Route.edge_filters graph, [:label, { prop: 'value' }] }

        its(:any?) { should be_true }
        its(:labels) { should == ['label'] }
        its(:properties) { should == [['prop', 'value']] }
      end

      context 'labels and extension' do
        let(:filters) { Pacer::Route.edge_filters graph, [:label, TP::Person] }

        its(:any?) { should be_true }
        its(:labels) { should == ['label'] }
        its(:extensions) { should == [TP::Person] }
        its(:properties) { should == [ %w[ type person ] ] }
      end

      context 'labels and simple extension' do
        let(:filters) { Pacer::Route.edge_filters graph, [:label, Tackle::SimpleMixin] }

        its(:any?) { should be_true }
        its(:labels) { should == ['label'] }
        its(:extensions) { should == [Tackle::SimpleMixin] }
        its(:properties) { should be_empty }
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

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