spec/arborist/node_spec.rb in arborist-0.0.1.pre20161005112841 vs spec/arborist/node_spec.rb in arborist-0.0.1.pre20161005182540

- old
+ new

@@ -6,10 +6,15 @@ require 'arborist/node' describe Arborist::Node do + before( :all ) do + Arborist::Event.load_all + end + + let( :concrete_class ) { TestNode } let( :subnode_class ) { TestSubNode } let( :identifier ) { 'the_identifier' } let( :identifier2 ) { 'the_other_identifier' } @@ -841,10 +846,30 @@ expect( node ).to be_quieted expect( node ).to have_downed_dependencies # :TODO: Quieted description? end + + it "broadcasts events generated by handled event transitions" do + vmhost01 = concrete_class.new( 'vmhost01' ) + vm01 = concrete_class.new( 'vm01' ) do + parent 'vmhost01' + end + memcache = described_class.new( 'memcache' ) do + parent 'vm01' + end + + mgr = Arborist::Manager.new + mgr.load_tree([ vmhost01, vm01, memcache ]) + + events = vmhost01. + update( ack: {message: "Imma gonna f up yo' sash", sender: "GOD"} ) + vmhost01.publish_events( *events ) + + expect( memcache ).to be_quieted + end + end describe "operational attribute modification" do @@ -878,10 +903,9 @@ it "arrayifies tags modifications" do node.modify( tags: 'single' ) expect( node.tags ).to eq( %w[single] ) end - end end