Sha256: 5f5c48c0c47d02c3d0484fe5f30a0e78bcf421eff6105f26e155583dab98143f

Contents?: true

Size: 1.57 KB

Versions: 19

Compression:

Stored size: 1.57 KB

Contents

require 'test_helper'

module Vedeu

  module Renderers

    describe Terminal do

      let(:described) { Vedeu::Renderers::Terminal }
      let(:instance)  { described.new(options) }
      let(:options)   { {} }
      let(:_name)     {}
      let(:output)    {
        Vedeu::Models::Page.coerce([
          [
            Vedeu::Models::Cell.new(position: [1, 1]),
            Vedeu::Views::Char.new(name: _name, value: 'a', position: [1, 2]),
            Vedeu::Models::Cell.new(position: [1, 3]),
          ], [
            Vedeu::Models::Cell.new(position: [2, 1]),
            Vedeu::Views::Char.new(name: _name, value: 'b', position: [2, 2]),
            Vedeu::Models::Cell.new(position: [2, 3]),
          ], [
            Vedeu::Models::Cell.new(position: [3, 1]),
            Vedeu::Views::Char.new(name: _name, value: 'c', position: [3, 2]),
            Vedeu::Models::Cell.new(position: [3, 3]),
          ],
        ])
      }

      before do
        Vedeu::Terminal.stubs(:output).returns(output)
      end

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

      describe '#clear' do
        before { Vedeu::Terminal.stubs(:clear) }

        subject { instance.clear }

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

      describe '#render' do
        subject { instance.render(output) }

        it { subject.must_be_instance_of(Vedeu::Models::Page) }
      end

    end # Terminal

  end # Renderers

end # Vedeu

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
vedeu-0.6.71 test/lib/vedeu/renderers/terminal_test.rb
vedeu-0.6.70 test/lib/vedeu/renderers/terminal_test.rb
vedeu-0.6.69 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.68 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.67 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.66 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.65 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.64 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.63 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.62 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.61 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.60 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.59 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.58 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.57 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.56 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.54 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.53 test/lib/vedeu/output/renderers/terminal_test.rb
vedeu-0.6.52 test/lib/vedeu/output/renderers/terminal_test.rb