Sha256: 3aae9e8df7bdee0db377d1ee306ce9407ef6d8fb292949e206031d8294c66bb8

Contents?: true

Size: 699 Bytes

Versions: 5

Compression:

Stored size: 699 Bytes

Contents

require 'saddle'
require 'saddle/middleware/logging/statsd'



describe Saddle::Middleware::Logging::StatsdLogger do

  context "test Statsd middleware" do

    it "with a request" do
      class StatsdClient < Saddle::Client
        add_middleware({
          :klass => Saddle::Middleware::Logging::StatsdLogger,
          :args => ['127.0.0.1'],
        })
      end

      client = StatsdClient.create(
        :stubs => Faraday::Adapter::Test::Stubs.new do |stub|
          stub.get('/test') {
            [
              200,
              {},
              'Party on!',
            ]
          }
        end
      )
      client.requester.get('/test').should == 'Party on!'
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
saddle-0.0.31 spec/middleware/logging/statsd_spec.rb
saddle-0.0.30 spec/middleware/logging/statsd_spec.rb
saddle-0.0.27 spec/middleware/logging/statsd_spec.rb
saddle-0.0.26 spec/middleware/statsd_spec.rb
saddle-0.0.25 spec/middleware/statsd_spec.rb