Sha256: 4f7f8a6c59676e34e9ff9dfd1a08089e904550b7229c63837274a398b13bdb35

Contents?: true

Size: 513 Bytes

Versions: 1

Compression:

Stored size: 513 Bytes

Contents

require 'test/unit'
require 'iz'

class TestMac < Test::Unit::TestCase

  def valid_mac_values
    ['aabbccddeeff', 'aa:bb:cc:dd:ee:ff', '11-22-33-44-55-66']
  end

  def invalid_mac_values
    [nil, false, -1, '', '1112', 'g', '10101a']
  end

  def test_that_mac_values_return_true
    valid_mac_values.each do |mac|
      puts mac.inspect
      assert Iz.mac?(mac)
    end
  end

  def test_that_invalid_mac_values_return_false
    invalid_mac_values.each do |mac|
      assert !Iz.mac?(mac)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iz-0.0.1 test/test_mac.rb