Sha256: d47b4b94099fd07f896f2f05b14175fbb9f3a505dcc90916ed19fef229bbb15a

Contents?: true

Size: 868 Bytes

Versions: 1

Compression:

Stored size: 868 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/module/sort_on.rb
#
# Extracted Tue Jul 25 10:07:15 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/core/module/sort_on.rb'


  require 'test/unit'

  class TCModule < Test::Unit::TestCase

    def test_sort_on
      c = Class.new
      c.class_eval {
        def initialize(a,b)
          @a=a; @b=b
        end
        sort_on :a,:b
      }
      a = [c.new(10,20),c.new(10,30)]
      assert_equal( a, a.sort )
      a = [c.new(10,30),c.new(10,20)]
      assert_equal( a.reverse, a.sort )
      a = [c.new(10,10),c.new(20,10)]
      assert_equal( a, a.sort )
      a = [c.new(20,10),c.new(10,10)]
      assert_equal( a.reverse, a.sort )
      a = [c.new(10,30),c.new(20,10)]
      assert_equal( a, a.sort )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.7.0 test/lib/facets/core/module/test_sort_on.rb