Sha256: 27dcdd09e53af3ceb874e25b802719cc3122624474e6e8bea3ffb2978e3f8b15

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

#!/usr/bin/env ruby

# to_proc.rb
# Symbol#to_proc unit tests

require 'test/unit'
require 'pathname'
dir = Pathname.new(File.expand_path(__FILE__)).realpath
require File.join(File.dirname(dir.to_s), '../lib/rex')

class ToProcTests < Test::Unit::TestCase
  def test_to_proc
    expected = 5050
    actual = nil

    assert_nothing_raised do
      actual = (1..100).inject(&:+)
    end

    assert_not_nil(actual)
    assert_equal(Fixnum, actual.class)
    assert_equal(expected, actual)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rex-0.0.4 test/to_proc.rb