Sha256: 825eb79955ca49e98d22881f1894e51d91e6d7da9b2edb6f0d302d99d3ab78ea

Contents?: true

Size: 868 Bytes

Versions: 1

Compression:

Stored size: 868 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/module/sort_on.rb
#
# Extracted Wed Aug 23 18:22:52 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.30 test/lib/facets/core/module/test_sort_on.rb