Sha256: 50b7f7d979714d2ccbc901a0ae75167604cab0e2a425ead1d4a3ad26ad69a0b4

Contents?: true

Size: 524 Bytes

Versions: 12

Compression:

Stored size: 524 Bytes

Contents

require 'test_helper'

module Vedeu
  describe Position do
    describe '#to_s' do
      it 'returns an escape sequence when no coordinates are provided' do
        Position.new.to_s.must_equal("\e[1;1H")
      end

      it 'returns an escape sequence when coordinates are provided' do
        Position.new(12, 19).to_s.must_equal("\e[12;19H")
      end

      it 'resets to starting position when a block is given' do
        Position.new(4, 9).to_s { 'test' }.must_equal("\e[4;9Htest\e[4;9H")
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
vedeu-0.2.4 test/lib/vedeu/support/position_test.rb
vedeu-0.2.3 test/lib/vedeu/support/position_test.rb
vedeu-0.2.2 test/lib/vedeu/support/position_test.rb
vedeu-0.2.1 test/lib/vedeu/support/position_test.rb
vedeu-0.2.0 test/lib/vedeu/support/position_test.rb
vedeu-0.1.19 test/lib/vedeu/support/position_test.rb
vedeu-0.1.18 test/lib/vedeu/support/position_test.rb
vedeu-0.1.17 test/lib/vedeu/support/position_test.rb
vedeu-0.1.16 test/lib/vedeu/support/position_test.rb
vedeu-0.1.15 test/lib/vedeu/support/position_test.rb
vedeu-0.1.14 test/lib/vedeu/support/position_test.rb
vedeu-0.1.13 test/lib/vedeu/support/position_test.rb