Changeset 226

Show
Ignore:
Timestamp:
08/31/08 19:54:50 (4 months ago)
Author:
pwh
Message:
  • l3_interface_test.rb: Added a test to verify the ipv4_network? method
    works correctly.
  • l3_interfaces.yml: Added an example interface as a fixture.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/test/fixtures/l3_interfaces.yml

    r13 r226  
    1 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html 
    2  
    3 # one: 
    4 #   column: value 
    5 
    6 # two: 
    7 #   column: value 
     1l3_interface_1: 
     2  id:              1 
     3  l2_interface_id: 1 
     4  ipv4_address:    10.0.0.1 
     5   
  • nethorus/test/unit/l3_interface_test.rb

    r128 r226  
    117117 
    118118 
     119  # TODO: Write code to test !valid? within ipv4_network? 
     120 
     121 
    119122  # Test that the ipv4_address 10.127.127.127 is correctly reported as being inside network 10.0.0.0/8 
    120123   
     
    142145  end 
    143146 
     147 
     148  # Test that an invalid L3Interface address returns a nil value for ipv4_network? 
     149   
     150  def test_l3_interface_returns_nil_when_network_invalid 
     151   
     152    l3_interface = L3Interface.new 
     153    assert(l3_interface.ipv4_network? == nil, "The IPv4 network for an invalid L3Interface should be nil") 
     154   
     155  end 
     156 
    144157end