Sha256: bbef59e2a117f32b9fe5db0f29051d08b36aca76411c26211c1c2b2834e346fb

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 Bytes

Contents

#
# File::       test_SymbolComparisons.rb
# Author::     wkm
# Copyright::  2009
# License::    GPL
#
# Unit tests for the spaceship method and hence sorting of symbols
#

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')

require 'test/unit'
require 'sitefuel/extensions/SymbolComparison'

class TestSymbolComparisons < Test::Unit::TestCase
  def test_spaceship
    assert_equal(-1, :a<=>:b)
    assert_equal  0, :a<=>:a
    assert_equal  1, :b<=>:a

    assert_equal(-1, :a<=>:ab)
  end

  def test_sort
    assert_equal [:a, :b, :c], [:c, :a, :b].sort
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sitefuel-0.0.0b test/test_SymbolComparison.rb
sitefuel-0.0.0a test/test_SymbolComparison.rb