spec/support/cmap.rb in mongo-2.11.0.rc0 vs spec/support/cmap.rb in mongo-2.11.0
- old
+ new
@@ -33,16 +33,13 @@
# @return [ EventSubscriber ] subscriber The subscriber receiving the CMAP events.
attr_reader :subscriber
# Instantiate the new spec.
#
- # @example Create the spec.
- # Spec.new(file)
- #
- # @param [ String ] file The name of the file.
- def initialize(file)
- @test = YAML.load(ERB.new(File::read(file)).result)
+ # @param [ String ] test_path The path to the file.
+ def initialize(test_path)
+ @test = YAML.load(File.read(test_path))
@description = @test['description']
@pool_options = Utils.snakeize_hash(process_options(@test['poolOptions']))
@spec_ops = @test['operations'].map { |o| Operation.new(self, o) }
@processed_ops = []
@@ -97,39 +94,46 @@
}
when Mongo::Monitoring::Event::Cmap::ConnectionCreated
{
'type' => 'ConnectionCreated',
'connectionId' => event.connection_id,
+ 'address' => event.address,
}
when Mongo::Monitoring::Event::Cmap::ConnectionReady
{
'type' => 'ConnectionReady',
'connectionId' => event.connection_id,
+ 'address' => event.address,
}
when Mongo::Monitoring::Event::Cmap::ConnectionClosed
{
'type' => 'ConnectionClosed',
'connectionId' => event.connection_id,
'reason' => event.reason,
+ 'address' => event.address,
}
when Mongo::Monitoring::Event::Cmap::ConnectionCheckOutStarted
{
'type' => 'ConnectionCheckOutStarted',
- }
+ 'address' => event.address,
+ }
when Mongo::Monitoring::Event::Cmap::ConnectionCheckOutFailed
{
'type' => 'ConnectionCheckOutFailed',
'reason' => event.reason,
+ 'address' => event.address,
}
when Mongo::Monitoring::Event::Cmap::ConnectionCheckedOut
{
'type' => 'ConnectionCheckedOut',
'connectionId' => event.connection_id,
+ 'address' => event.address,
}
when Mongo::Monitoring::Event::Cmap::ConnectionCheckedIn
{
'type' => 'ConnectionCheckedIn',
'connectionId' => event.connection_id,
+ 'address' => event.address,
}
when Mongo::Monitoring::Event::Cmap::PoolCleared
{
'type' => 'ConnectionPoolCleared',
'address' => event.address,