Sha256: eef920805dbad96d9382ed9dd663046e355b373b889775d114cee13489920bb7
Contents?: true
Size: 1.11 KB
Versions: 2
Compression:
Stored size: 1.11 KB
Contents
#!/usr/bin/env rspec -cfd require_relative '../../spec_helper' require 'arborist/node' require 'arborist/subscription' require 'arborist/event/node' describe Arborist::Event::Node do let( :node ) do TestNode.new( 'foo' ) do parent 'bar' description "A testing node" tags :yelp, :yank, :yore, :yandex update( "tcp_socket_connect" => { "time" => "2016-02-25 16:04:35 -0800", "duration" => 0.020619 } ) end end let( :event ) { described_class.new(node) } it "matches match-anything subscriptions" do sub = Arborist::Subscription.new {} expect( event ).to match( sub ) end it "matches subscriptions which have matching criteria" do criteria = { tag: node.tags.last, status: node.status } sub = Arborist::Subscription.new( nil, criteria ) {} expect( event ).to match( sub ) end it "matches subscriptions which have non-matching negative criteria" do pending "Adding negative criteria to subscriptions" negative_criteria = { tag: 'nope' } sub = Arborist::Subscription.new( nil, {}, negative_criteria ) {} expect( event ).to match( sub ) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
arborist-0.0.1.pre20160829140603 | spec/arborist/event/node_spec.rb |
arborist-0.0.1.pre20160606141735 | spec/arborist/event/node_spec.rb |