spec/trema/dsl/runner_spec.rb in trema-0.2.2.1 vs spec/trema/dsl/runner_spec.rb in trema-0.2.3

- old
+ new

@@ -33,30 +33,10 @@ SwitchManager.stub!( :new ).and_return( @switch_manager ) end context "when running" do - it "should run tremashark" do - tremashark = mock - tremashark.should_receive( :run ).once - - context = mock( - "context", - :tremashark => tremashark, - :switch_manager => nil, - :packetin_filter => nil, - :links => {}, - :hosts => {}, - :switches => {}, - :apps => {}, - :port => 6633 - ) - - Runner.new( context ).run - end - - it "should run switch_manager" do @switch_manager.should_receive( :run! ).once context = mock( "context", @@ -94,20 +74,20 @@ end it "should create links" do link0 = mock( "link0" ) - link0.should_receive( :delete! ).once.ordered - link0.should_receive( :enable! ).once.ordered + link0.should_receive( :delete! ).once + link0.should_receive( :enable! ).once link1 = mock( "link1" ) - link1.should_receive( :delete! ).once.ordered - link1.should_receive( :enable! ).once.ordered + link1.should_receive( :delete! ).once + link1.should_receive( :enable! ).once link2 = mock( "link2" ) - link2.should_receive( :delete! ).once.ordered - link2.should_receive( :enable! ).once.ordered + link2.should_receive( :delete! ).once + link2.should_receive( :enable! ).once context = mock( "context", :tremashark => nil, :switch_manager => mock( "switch manager", :run! => nil ), @@ -126,25 +106,25 @@ it "should run vhosts" do host0 = mock( "host0" ) host1 = mock( "host1" ) host2 = mock( "host2" ) - host0.should_receive( :run! ).once.ordered + host0.should_receive( :run! ).once host0.should_receive( :add_arp_entry ).with do | arg | arg.size.should == 2 arg.should include( host1 ) arg.should include( host2 ) end - host1.should_receive( :run! ).once.ordered + host1.should_receive( :run! ).once host1.should_receive( :add_arp_entry ).with do | arg | arg.size.should == 2 arg.should include( host0 ) arg.should include( host2 ) end - host2.should_receive( :run! ).once.ordered + host2.should_receive( :run! ).once host2.should_receive( :add_arp_entry ).with do | arg | arg.size.should == 2 arg.should include( host0 ) arg.should include( host1 ) end @@ -165,16 +145,16 @@ end it "should run switches" do switch0 = mock( "switch0" ) - switch0.should_receive( :run! ).once.ordered + switch0.should_receive( :run! ).once switch1 = mock( "switch1" ) - switch1.should_receive( :run! ).once.ordered + switch1.should_receive( :run! ).once switch2 = mock( "switch2" ) - switch2.should_receive( :run! ).once.ordered + switch2.should_receive( :run! ).once context = mock( "context", :tremashark => nil, :switch_manager => mock( "switch manager", :run! => nil ),