spec/spec_helper.rb in logstash-logger-0.12.0 vs spec/spec_helper.rb in logstash-logger-0.13.0
- old
+ new
@@ -1,7 +1,14 @@
require 'pry'
+require 'simplecov'
+SimpleCov.start
+if ENV['CI']=='true'
+ require 'codecov'
+ SimpleCov.formatter = SimpleCov::Formatter::Codecov
+end
+
RSpec.configure do |config|
config.order = "random"
config.before(:suite) do
puts "Testing with #{CONNECTION_TYPE.to_s.upcase} socket type"
@@ -47,15 +54,27 @@
let(:unix_device) { LogStashLogger::Device.new(type: :unix, path: '/tmp/logstash') }
let(:file) { Tempfile.new('test') }
let(:file_device) { LogStashLogger::Device.new(type: :file, path: file.path)}
+ let(:io) { StringIO.new }
let(:io_device) { LogStashLogger::Device.new(type: :io, io: io)}
let(:redis_device) { LogStashLogger::Device.new(type: :redis, sync: true) }
let(:kafka_device) { LogStashLogger::Device.new(type: :kafka, sync: true) }
- let(:multi_delegator_device) { LogStashLogger::Device.new([{type: :stdout}, {type: :io, io: io}]) }
- let(:balancer_device) { LogStashLogger::Device.new(type: :balancer, outputs: [{type: :stdout}, {type: :io, io: io}]) }
+
+ let(:outputs) { [{type: :stdout}, {type: :io, io: io}] }
+ let(:multi_delegator_device) { LogStashLogger::Device.new(type: :multi_delegator, outputs: outputs) }
+ let(:balancer_device) { LogStashLogger::Device.new(type: :balancer, outputs: outputs) }
+ let(:multi_logger) do
+ LogStashLogger.new(
+ type: :multi_logger,
+ outputs: [
+ { type: :stdout, formatter: ::Logger::Formatter },
+ { type: :io, io: io }
+ ]
+ )
+ end
let(:udp_uri) { "udp://localhost:5228" }
let(:tcp_uri) { "tcp://localhost:5229" }
let(:unix_uri) { "unix:///some/path/to/socket" }
let(:file_uri) { "file://#{file.path}" }