Sha256: 566f108abd6cb545d8e45846e3450527651c341115d771d6ad0bcd8149312d62

Contents?: true

Size: 968 Bytes

Versions: 90

Compression:

Stored size: 968 Bytes

Contents

require 'spec_helper'

describe Appsignal::Aggregator::Middleware::DeleteBlanks do
  let(:klass) { Appsignal::Aggregator::Middleware::DeleteBlanks }
  let(:delete_blanks) { klass.new }

  describe "#call" do
    let(:event) do
      notification_event(
        :name => 'something',
        :payload => create_payload(payload)
      )
    end
    let(:payload) do
      {
        :string => 'not empty',
        :array => ['something'],
        :hash => {'something' => 'something'},
        :empty_string => '',
        :empty_array => [],
        :empty_hash => {},
        :nil => nil
      }
    end
    subject { event.payload }
    before { delete_blanks.call(event) { } }

    it { should have_key(:string) }
    it { should have_key(:array) }
    it { should have_key(:hash) }

    it { should_not have_key(:empty_string) }
    it { should_not have_key(:empty_array) }
    it { should_not have_key(:empty_hash) }
    it { should_not have_key(:nil) }
  end
end

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
appsignal-0.11.18 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.17 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.16 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.15 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.14 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.14.beta.1 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.13 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.13.beta.4 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.13.beta.3 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.13.beta.2 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.13.beta.1 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.13.beta.0 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.12 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.11 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.10 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.10.beta.2 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.10.beta.1 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.9 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.8.beta.4 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb
appsignal-0.11.8.beta.3 spec/lib/appsignal/aggregator/middleware/delete_blanks_spec.rb