Sha256: d21e2e1ae815577ae1c9c6abf9e2011caad947a5d94cb0325a6451e09295122c

Contents?: true

Size: 1010 Bytes

Versions: 2

Compression:

Stored size: 1010 Bytes

Contents

require 'test_helper'

module Vedeu
  describe Clear do
    before { API::Store.reset }

    describe '.call' do
      it 'returns the escape sequence to clear the whole interface' do
        interface = Interface.new({
          name:   'Clear.call',
          geometry: {
            width:  5,
            height: 2
          }
        })
        Clear.call(interface).must_equal(
          "\e[1;1H     \e[1;1H" \
          "\e[2;1H     \e[2;1H"
        )
      end

      it 'returns the escape sequence to clear the whole interface with specified colours' do
        interface = Interface.new({
          name:   'Clear.call',
          geometry: {
            width:  5,
            height: 2,
          },
          colour: {
            foreground: '#00ff00',
            background: '#ffff00'
          }
        })
        Clear.call(interface).must_equal(
          "\e[38;5;46m\e[48;5;226m" \
          "\e[1;1H     \e[1;1H" \
          "\e[2;1H     \e[2;1H"
        )
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.1.12 test/lib/vedeu/output/clear_test.rb
vedeu-0.1.10 test/lib/vedeu/output/clear_test.rb