$:.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