Sha256: 740653d69565fc59fd9f1b44b59e6a9964dffdd9d1c14d5e49abb7866e1928a8

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

#! /usr/bin/env ruby
# coding: utf-8

require 'helper'
require "test/unit"
require "string/integer"

class TC_String_Integer < Test::Unit::TestCase
  def test_integer?
    assert_equal(false, String.integer?("あいうえお"))
    assert_equal(true , String.integer?("123"       ))
    assert_equal(false, String.integer?("3.14"      ))
    assert_equal(false, String.integer?("12345"))

    assert_equal(false, "あいうえお".integer?)
    assert_equal(true , "123"       .integer?)
    assert_equal(false, "3.14"      .integer?)
    assert_equal(false, "12345".integer?)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
builtinextension-0.1.4 test/string/test_integer.rb