Sha256: 8331fff7e445256732d1f09257f6e4a7090f7067e52bf7eb91cd9457ee5e3452

Contents?: true

Size: 1.34 KB

Versions: 12

Compression:

Stored size: 1.34 KB

Contents

require 'test_helper'

module Vedeu

  module Output

    describe Output do

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

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

      describe '.render_output' do
        subject { described.render_output(output) }

        context 'when the output is empty' do
          it { subject.must_be_instance_of(NilClass) }
        end

        context 'when the output is not empty' do
          context 'and the output is an escape sequence' do
            let(:output) {
              Vedeu::Models::Escape.new(value: "\e[?25h", position: [1, 1])
            }

            it {
              Vedeu::Terminal.expects(:output)
              subject
            }
          end

          context 'and the output is not an escape sequence' do
            let(:output) { Vedeu::Models::Page.new }

            it {
              Vedeu::Terminal::Buffer.expects(:write).with(output)
              subject
            }
          end
        end
      end

      describe '#render_output' do
        it { instance.must_respond_to(:render_output) }
      end

    end # Output

  end # Output

end # Vedeu

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
vedeu-0.6.40 test/lib/vedeu/output/output_test.rb
vedeu-0.6.39 test/lib/vedeu/output/output_test.rb
vedeu-0.6.38 test/lib/vedeu/output/output_test.rb
vedeu-0.6.37 test/lib/vedeu/output/output_test.rb
vedeu-0.6.36 test/lib/vedeu/output/output_test.rb
vedeu-0.6.35 test/lib/vedeu/output/output_test.rb
vedeu-0.6.34 test/lib/vedeu/output/output_test.rb
vedeu-0.6.33 test/lib/vedeu/output/output_test.rb
vedeu-0.6.32 test/lib/vedeu/output/output_test.rb
vedeu-0.6.31 test/lib/vedeu/output/output_test.rb
vedeu-0.6.30 test/lib/vedeu/output/output_test.rb
vedeu-0.6.29 test/lib/vedeu/output/output_test.rb