Sha256: 2789844e62e3ea558287ea94478d0c666874452649ae4d44060c85a020f9c290
Contents?: true
Size: 1.05 KB
Versions: 4
Compression:
Stored size: 1.05 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 negative_criteria = { tag: 'nope' } sub = Arborist::Subscription.new( nil, {}, negative_criteria ) {} expect( event ).to match( sub ) end end
Version data entries
4 entries across 4 versions & 1 rubygems