Sha256: 30ece3febba30c3d5a03972cb47e9707654e6bc49f7f7a8992f5228cac198294

Contents?: true

Size: 717 Bytes

Versions: 2

Compression:

Stored size: 717 Bytes

Contents

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

require 'test/unit'
require 'libnet4r'

class TC_Libnet_Init
  def test_init
    # default injection type should be :raw4
    assert_equal(Libnet.new.injection_type, :raw4)

    assert_equal(Libnet.new(:raw4).injection_type, :raw4)
    assert_equal(Libnet.new('raw4').injection_type, :raw4)
    assert_equal(Libnet.new(:raw).injection_type, :raw4)
    assert_equal(Libnet.new('raw').injection_type, :raw4)

    assert_equal(Libnet.new(:link).injection_type, :link)
    assert_equal(Libnet.new('link').injection_type, :link)

    assert_equal(Libnet.new(:raw4, 'en0').device, 'en0')

    assert_raise ArgumentError do
      Libnet.new(:foo)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
libnet4r-0.1 test/tc_init.rb
libnet4r-0.2 test/tc_init.rb