Sha256: 50b6bc203ea7e2185b005f3d6f59857736ed67400ea5bb4706f3817606a6db94

Contents?: true

Size: 1.22 KB

Versions: 16

Compression:

Stored size: 1.22 KB

Contents

require 'test_helper'

module Vedeu

  describe Output do

    let(:described) { Vedeu::Output }
    let(:instance)  { described.new(output) }
    let(:output)    {}
    let(:drb)       { false }

    before do
      Vedeu::Configuration.stubs(:drb?).returns(drb)
      Vedeu.renderers.stubs(:render)
    end

    describe '#initialize' do
      it { instance.must_be_instance_of(described) }
      it { instance.instance_variable_get('@output').must_equal(output) }
    end

    describe '.render' do
      before { Vedeu.renderers.stubs(:render) }

      subject { described.render(output) }

      context 'when DRb is enabled' do
        let(:drb)            { true }
        let(:virtual_buffer) { [] }

        before do
          # Vedeu::Renderers::HTML.stubs(:to_file)
          Vedeu::VirtualBuffer.stubs(:retrieve).returns(virtual_buffer)
        end

        it {
          Vedeu.expects(:trigger).with(:_drb_store_output_, output)
          subject
        }

        # it 'writes the virtual buffer to a file' do
        #   Vedeu::Renderers::HTML.expects(:to_file).with(virtual_buffer)
        #   subject
        # end
      end

      it { Vedeu.renderers.expects(:render).with(output); subject }
    end

  end # Output

end # Vedeu

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vedeu-0.5.0 test/lib/vedeu/output/output_test.rb
vedeu-0.4.65 test/lib/vedeu/output/output_test.rb
vedeu-0.4.64 test/lib/vedeu/output/output_test.rb
vedeu-0.4.63 test/lib/vedeu/output/output_test.rb
vedeu-0.4.62 test/lib/vedeu/output/output_test.rb
vedeu-0.4.61 test/lib/vedeu/output/output_test.rb
vedeu-0.4.60 test/lib/vedeu/output/output_test.rb
vedeu-0.4.59 test/lib/vedeu/output/output_test.rb
vedeu-0.4.58 test/lib/vedeu/output/output_test.rb
vedeu-0.4.57 test/lib/vedeu/output/output_test.rb
vedeu-0.4.56 test/lib/vedeu/output/output_test.rb
vedeu-0.4.55 test/lib/vedeu/output/output_test.rb
vedeu-0.4.54 test/lib/vedeu/output/output_test.rb
vedeu-0.4.53 test/lib/vedeu/output/output_test.rb
vedeu-0.4.52 test/lib/vedeu/output/output_test.rb
vedeu-0.4.51 test/lib/vedeu/output/output_test.rb