Sha256: 746a2e781fb24e5675f90ab45a5fb71256cf2ff69a309ce3d66394582be553b4

Contents?: true

Size: 911 Bytes

Versions: 15

Compression:

Stored size: 911 Bytes

Contents

require 'spec_helper'

describe Konacha::Engine do
  describe ".formatters" do
    it "defaults to a Konacha::Formatter pointing to STDOUT" do
      Konacha::Formatter.should_receive(:new).with(STDOUT) { :formatter }
      Konacha::Engine.formatters.should == [:formatter]
    end

    context "with a FORMAT environment variable" do
      before do
        class TestFormatter
          def initialize(io)
          end
        end
        ENV['FORMAT'] = 'Konacha::Formatter,TestFormatter'
      end

      after do
        Object.send(:remove_const, :TestFormatter)
        ENV.delete('FORMAT')
      end

      it "creates the specified formatters" do
        Konacha::Formatter.should_receive(:new).with(STDOUT) { :formatter }
        TestFormatter.should_receive(:new).with(STDOUT) { :test_formatter }
        Konacha::Engine.formatters.should == [:formatter, :test_formatter]
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
konacha-4.0.0 spec/engine_spec.rb
konacha-3.7.0 spec/engine_spec.rb
konacha-3.6.0 spec/engine_spec.rb
konacha-3.5.1 spec/engine_spec.rb
konacha-3.5.0 spec/engine_spec.rb
konacha-3.4.0 spec/engine_spec.rb
konacha-3.3.0 spec/engine_spec.rb
konacha-3.2.5 spec/engine_spec.rb
konacha-3.2.4 spec/engine_spec.rb
konacha-3.2.3 spec/engine_spec.rb
konacha-3.2.2 spec/engine_spec.rb
konacha-3.2.1 spec/engine_spec.rb
konacha-3.2.0 spec/engine_spec.rb
konacha-3.1.0 spec/engine_spec.rb
konacha-3.0.0 spec/engine_spec.rb