Sha256: e4b385f82bcc5d4806abbbc82d05fd6f0e1014ffe83551a3fafbf944dcdce343

Contents?: true

Size: 578 Bytes

Versions: 10

Compression:

Stored size: 578 Bytes

Contents

require 'spec_helper'

describe Mulder::Formatter do
  describe '.initialize' do
    it 'raises an error of the format is not implemented' do
      expect {
        described_class.new([], 'foo')
      }.to raise_error(NotImplementedError, 'Formatting as foo has not been implemented!')
    end
  end

  describe "#output" do
    it 'sends the correct formatter the instances' do
      mock_instances = mock
      Mulder::Formats::Human.expects(:new).with(mock_instances).returns(mock(output: 'foo'))
      Mulder::Formatter.new(mock_instances, 'human').output
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mulder-0.4.0 spec/lib/mulder/formatter_spec.rb
mulder-0.3.2 spec/lib/mulder/formatter_spec.rb
mulder-0.3.1 spec/lib/mulder/formatter_spec.rb
mulder-0.3.0 spec/lib/mulder/formatter_spec.rb
mulder-0.2.1 spec/lib/mulder/formatter_spec.rb
mulder-0.2.0 spec/lib/mulder/formatter_spec.rb
mulder-0.1.0 spec/lib/mulder/formatter_spec.rb
mulder-0.0.5 spec/lib/mulder/formatter_spec.rb
mulder-0.0.4 spec/lib/mulder/formatter_spec.rb
mulder-0.0.3 spec/lib/mulder/formatter_spec.rb