Sha256: 1d068c787a6955d09a675e4eee5c7eba56cfb2a82d3c30bd53ee994a9504b177

Contents?: true

Size: 454 Bytes

Versions: 6

Compression:

Stored size: 454 Bytes

Contents

require 'test/unit'
require 'extensions/symbol'

class TC_Symbol < Test::Unit::TestCase
  def test_to_proc
    x = (1..10).inject(&:*)
    assert_equal(3628800, x)

    x = %w{foo bar qux}.map(&:reverse)
    assert_equal(%w{oof rab xuq}, x)

    x = [1, 2, nil, 3, nil].reject(&:nil?)
    assert_equal([1, 2, 3], x)

    x = %w{ruby and world}.sort_by(&:reverse)
    assert_equal(%w{world and ruby}, x)
  end
end  # class TC_Symbol

Version data entries

6 entries across 3 versions & 1 rubygems

Version Path
extensions-0.4.0 ./test/tc_symbol.rb
extensions-0.6.0 ./test/tc_symbol.rb
extensions-0.5.0 ./test/tc_symbol.rb
extensions-0.4.0 test/tc_symbol.rb
extensions-0.5.0 test/tc_symbol.rb
extensions-0.6.0 test/tc_symbol.rb