Sha256: db0732bbdba5c317f03ebcab3e02dbde4aba497598ff3177511464188bff2ddf

Contents?: true

Size: 942 Bytes

Versions: 20

Compression:

Stored size: 942 Bytes

Contents

require 'spec_helper'
require 'logger'
require 'stringio'

describe Dragonfly do
  it "returns a default app" do
    Dragonfly.app.should == Dragonfly::App.instance
  end

  it "returns a named app" do
    Dragonfly.app(:mine).should == Dragonfly::App.instance(:mine)
  end

  describe "logging" do
    before do
      Dragonfly.logger = Logger.new(StringIO.new)
    end

    it "debugs" do
      Dragonfly.logger.should_receive(:debug).with(/something/)
      Dragonfly.debug("something")
    end

    it "warns" do
      Dragonfly.logger.should_receive(:warn).with(/something/)
      Dragonfly.warn("something")
    end

    it "shows info" do
      Dragonfly.logger.should_receive(:info).with(/something/)
      Dragonfly.info("something")
    end
  end

  describe "deprecations" do
    it "raises a message when using Dragonfly[:name]" do
      expect {
        Dragonfly[:images]
      }.to raise_error(/deprecated/)
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
dragonfly-1.2.0 spec/dragonfly_spec.rb
dragonfly-1.1.5 spec/dragonfly_spec.rb
dragonfly-1.1.4 spec/dragonfly_spec.rb
dragonfly-1.1.3 spec/dragonfly_spec.rb
dragonfly-1.1.2 spec/dragonfly_spec.rb
dragonfly-1.1.1 spec/dragonfly_spec.rb
dragonfly-1.1.0 spec/dragonfly_spec.rb
dragonfly-1.0.12 spec/dragonfly_spec.rb
dragonfly-1.0.11 spec/dragonfly_spec.rb
dragonfly-1.0.10 spec/dragonfly_spec.rb
dragonfly-1.0.9 spec/dragonfly_spec.rb
dragonfly-1.0.8 spec/dragonfly_spec.rb
dragonfly-1.0.7 spec/dragonfly_spec.rb
dragonfly-1.0.6 spec/dragonfly_spec.rb
dragonfly-1.0.5 spec/dragonfly_spec.rb
dragonfly-1.0.4 spec/dragonfly_spec.rb
dragonfly-1.0.3 spec/dragonfly_spec.rb
dragonfly-1.0.2 spec/dragonfly_spec.rb
dragonfly-1.0.1 spec/dragonfly_spec.rb
dragonfly-1.0 spec/dragonfly_spec.rb