Sha256: dec41cd6f07dd1aa750df119d42b56e45e19ba7c565d39fdab2b2f926a6824bb

Contents?: true

Size: 680 Bytes

Versions: 13

Compression:

Stored size: 680 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class SortTest < Test::Unit::TestCase
  include Ferret::Search

  def test_sort_marshalling
    [ Sort.new,
      Sort.new( [], :reverse => true) ,
      Sort.new([ Ferret::Search::SortField.new(:id, :reverse => true), 
                 Ferret::Search::SortField::SCORE,
                 Ferret::Search::SortField::DOC_ID ],
               :reverse => true),
      Sort.new([ Ferret::Search::SortField.new(:id), 
                 Ferret::Search::SortField::SCORE_REV,
                 Ferret::Search::SortField::DOC_ID_REV ])
    ].each do |sort|
      assert_equal sort.to_s, Sort._load(sort._dump(0)).to_s
    end 
  end

end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
cehoffman-acts_as_ferret-0.4.4 doc/demo/test/unit/sort_test.rb
jkraemer-acts_as_ferret-0.4.4 doc/demo/test/unit/sort_test.rb
watson-acts_as_ferret-0.4.8.2 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.5.2 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.4.8.2 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.4.8.1 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.5.1 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.5 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.4.8.rails3 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.4.8 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.4.7 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.4.6 doc/demo/test/unit/sort_test.rb
acts_as_ferret-0.4.4 doc/demo/test/unit/sort_test.rb