Sha256: 62dc9717cb58d527446daf6ebd6b6baa881e6fde2fcf76b56c55c01463946ac3

Contents?: true

Size: 560 Bytes

Versions: 5

Compression:

Stored size: 560 Bytes

Contents

require "spec_helper"

describe "formatter" do
  around :each do |example|
    example.run_with_retry retry: 10
  end

  it "does not hide errors when formatting" do
    class MockFormatter
      include Pubnub::SubscribeEvent::Formatter
    end

    class TestError < StandardError
      def message
        "This is a test"
      end
    end

    # ensure the correct error is raised instead of -> NoMethodError: undefined method `body'
    expect { MockFormatter.new.send(:format_envelopes, TestError.new('error'), nil) }.to raise_error(TestError)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pubnub-4.6.0 spec/lib/subscribe_event/formatter_spec.rb
pubnub-4.5.0 spec/lib/subscribe_event/formatter_spec.rb
pubnub-4.4.0 spec/lib/subscribe_event/formatter_spec.rb
pubnub-4.3.0 spec/lib/subscribe_event/formatter_spec.rb
pubnub-4.2.7 spec/lib/subscribe_event/formatter_spec.rb