Sha256: 27f9b380a34966ce725b713cab13e728a3001d1a3123bc2c25ac681adf3317a8

Contents?: true

Size: 1.95 KB

Versions: 8

Compression:

Stored size: 1.95 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 [: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 [:label, :label2] }

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

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

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

      context 'labels and properties' do
        let(:filters) { Pacer::Route.edge_filters [: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 [: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 [: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

8 entries across 8 versions & 1 rubygems

Version Path
pacer-1.3.5-java spec/pacer/filter/property_filter/edge_filters_spec.rb
pacer-1.3.4-java spec/pacer/filter/property_filter/edge_filters_spec.rb
pacer-1.3.3-java spec/pacer/filter/property_filter/edge_filters_spec.rb
pacer-1.3.2-java spec/pacer/filter/property_filter/edge_filters_spec.rb
pacer-1.3.1-java spec/pacer/filter/property_filter/edge_filters_spec.rb
pacer-1.2.0-java spec/pacer/filter/property_filter/edge_filters_spec.rb
pacer-1.1.1-java spec/pacer/filter/property_filter/edge_filters_spec.rb
pacer-1.1.0-java spec/pacer/filter/property_filter/edge_filters_spec.rb