Sha256: 5e03b4ea45ee0ca3df2a89edc0d92837153c8bfa7fd2b07ceca710539be546e6

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

require 'test_helper'
require 'vedeu/output/render_interface'
require 'vedeu/models/interface'
require 'vedeu/support/interface_store'

module Vedeu
  describe RenderInterface do
    before { InterfaceStore.reset }

    describe '.call' do
      it 'returns the content for the interface' do
        interface = Interface.new({
          name:   '.call',
          geometry: {
            width:  32,
            height: 3,
          },
          lines:  [
            {
              streams: [{ text: 'this is the first' }]
            }, {
              streams: { text: 'this is the second and it is long' }
            }, {
              streams: [
                { text: 'this is the third, ' },
                { text: 'it is even longer '  },
                { text: 'and still truncated' }
              ]
            }, {
              streams: [{ text: 'this should not render' }]
            }
          ]
        })
        RenderInterface.call(interface).must_equal(
          "\e[1;1H                                \e[1;1H" \
          "\e[2;1H                                \e[2;1H" \
          "\e[3;1H                                \e[3;1H" \
          "\e[1;1Hthis is the first" \
          "\e[2;1Hthis is the second and it is lon" \
          "\e[3;1Hthis is the third, it is even lo"
        )
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.1.5 test/lib/vedeu/output/render_interface_test.rb
vedeu-0.1.4 test/lib/vedeu/output/render_interface_test.rb