Sha256: 76e8843a59232332fa761944cc4d1e1a223406f40b4828448037f2c32e427974

Contents?: true

Size: 696 Bytes

Versions: 12

Compression:

Stored size: 696 Bytes

Contents

require 'unit_spec_helper'

describe Rpush::Daemon::Reflectable do
  class TestReflectable
    include Rpush::Daemon::Reflectable
  end

  let(:logger) { double(error: nil) }
  let(:test_reflectable) { TestReflectable.new }

  before do
    Rpush.reflections.stub(:__dispatch)
    Rpush.stub(logger: logger)
  end

  it 'dispatches the given reflection' do
    Rpush.reflections.should_receive(:__dispatch).with(:error)
    test_reflectable.reflect(:error)
  end

  it 'logs errors raise by the reflection' do
    error = StandardError.new
    Rpush.reflections.stub(:__dispatch).and_raise(error)
    Rpush.logger.should_receive(:error).with(error)
    test_reflectable.reflect(:error)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rpush-2.2.0-java spec/unit/daemon/reflectable_spec.rb
rpush-2.2.0 spec/unit/daemon/reflectable_spec.rb
rpush-2.1.0-java spec/unit/daemon/reflectable_spec.rb
rpush-2.1.0 spec/unit/daemon/reflectable_spec.rb
rpush-2.0.1-java spec/unit/daemon/reflectable_spec.rb
rpush-2.0.1 spec/unit/daemon/reflectable_spec.rb
rpush-2.0.0-java spec/unit/daemon/reflectable_spec.rb
rpush-2.0.0 spec/unit/daemon/reflectable_spec.rb
rpush-2.0.0.rc1-java spec/unit/daemon/reflectable_spec.rb
rpush-2.0.0.rc1 spec/unit/daemon/reflectable_spec.rb
rpush-2.0.0.beta2 spec/unit/daemon/reflectable_spec.rb
rpush-2.0.0.beta1 spec/unit/daemon/reflectable_spec.rb