Sha256: 0e820c3ae30177c3ed97f87ed8810849213ff1a5c5f7ae345c783da0ad1c6b6f

Contents?: true

Size: 1.18 KB

Versions: 32

Compression:

Stored size: 1.18 KB

Contents

require 'test_helper'

module Vedeu

  describe Output do

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

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

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

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

      subject { described.render(content) }

      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_, content)
          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(content); subject }
    end

  end # Output

end # Vedeu

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
vedeu-0.4.50 test/lib/vedeu/output/output_test.rb
vedeu-0.4.49 test/lib/vedeu/output/output_test.rb
vedeu-0.4.48 test/lib/vedeu/output/output_test.rb
vedeu-0.4.47 test/lib/vedeu/output/output_test.rb
vedeu-0.4.46 test/lib/vedeu/output/output_test.rb
vedeu-0.4.45 test/lib/vedeu/output/output_test.rb
vedeu-0.4.44 test/lib/vedeu/output/output_test.rb
vedeu-0.4.43 test/lib/vedeu/output/output_test.rb
vedeu-0.4.42 test/lib/vedeu/output/output_test.rb
vedeu-0.4.41 test/lib/vedeu/output/output_test.rb
vedeu-0.4.40 test/lib/vedeu/output/output_test.rb
vedeu-0.4.39 test/lib/vedeu/output/output_test.rb
vedeu-0.4.38 test/lib/vedeu/output/output_test.rb
vedeu-0.4.37 test/lib/vedeu/output/output_test.rb
vedeu-0.4.36 test/lib/vedeu/output/output_test.rb
vedeu-0.4.35 test/lib/vedeu/output/output_test.rb
vedeu-0.4.34 test/lib/vedeu/output/output_test.rb
vedeu-0.4.33 test/lib/vedeu/output/output_test.rb
vedeu-0.4.32 test/lib/vedeu/output/output_test.rb
vedeu-0.4.31 test/lib/vedeu/output/output_test.rb