Sha256: 417e36f4d5f807a69c57ad8d15dbcaeab1eb884d2561f1d2d6affaa1604249ec

Contents?: true

Size: 444 Bytes

Versions: 7

Compression:

Stored size: 444 Bytes

Contents

require "spec_helper"

describe Mongoid::Deprecation do

  let(:logger) do
    stub.quacks_like(Logger.allocate)
  end

  before do
    Logger.expects(:new).with($stdout).returns(logger)
  end

  describe "#alert" do

    let(:deprecation) do
      Mongoid::Deprecation.instance
    end

    it "calls warn on the memoized logger" do
      logger.expects(:warn).with("Deprecation: testing")
      deprecation.alert("testing")
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
mongoid-pre-2.0.0.beta1 spec/unit/mongoid/deprecation_spec.rb
mongoid-2.0.0.alpha spec/unit/mongoid/deprecation_spec.rb
mongoid-1.2.14 spec/unit/mongoid/deprecation_spec.rb
mongoid-1.2.13 spec/unit/mongoid/deprecation_spec.rb
mongoid-1.2.12 spec/unit/mongoid/deprecation_spec.rb
mongoid-1.2.11 spec/unit/mongoid/deprecation_spec.rb
mongoid-1.2.10 spec/unit/mongoid/deprecation_spec.rb