Sha256: 32d3b7d4f49eaf0af24ce3015ee450ddfce737189fb18511b062490c53d4ac3c

Contents?: true

Size: 536 Bytes

Versions: 38

Compression:

Stored size: 536 Bytes

Contents

require 'spec_helper'

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

  describe 'RandomFilter' do
    describe '#random' do
      it { Set[*graph.v.random(1)].should == Set[*graph.v] }
      it { graph.v.random(0).to_a.should == [] }
      it 'should usually have some number of elements more than 1 and less than all' do
        range = 1..(graph.v.count - 1)
        best2of3 = (0...3).map { graph.v.random(0.5).count }
        best2of3.select { |num| range.include? num }.length.should >= 2
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

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