spec/trema/packet-out_spec.rb in trema-0.2.5 vs spec/trema/packet-out_spec.rb in trema-0.2.6

- old
+ new

@@ -20,11 +20,11 @@ require File.join( File.dirname( __FILE__ ), "..", "spec_helper" ) require "trema" -class PacketOutController < Controller +class PacketOutController < Controller def packet_in datapath_id, message send_flow_mod_add( datapath_id, :match => Match.from( message ), :actions => Trema::ActionOutput.new( :port => 2 ) @@ -42,20 +42,20 @@ context "a controller instance" do it "should respond to #send_packet_out" do PacketOutController.new.should respond_to(:send_packet_out) end end - - + + context "when invoked with no datapath_id" do it "should raise an error" do lambda do PacketOutController.new.send_packet_out end.should raise_error("wrong number of arguments (0 for 1)") end end - - + + context "when #packet_in" do it "should #packet_out" do network { vswitch( "packet-out" ) { datapath_id 0xabc } vhost "host1"