Sha256: 88fa4f21b6d0af968821b7ece82d6e6e4e8117b8559f904fb4984bc97279d323

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

RSpec.describe TTY::Box, ':top, :left options' do
  it "skips positioning when no top & left values provided" do
    output = TTY::Box.frame(width: 35, height: 4)

    expect(output).to eq([
      "┌─────────────────────────────────┐\n",
      "│                                 │\n",
      "│                                 │\n",
      "└─────────────────────────────────┘\n"
    ].join)
  end

  it "allows to absolutely position within the terminal window" do
    output = TTY::Box.frame(top: 10, left: 40, width: 35, height: 4)

    expect(output).to eq([
      "\e[11;41H┌─────────────────────────────────┐",
      "\e[12;41H│\e[12;75H│",
      "\e[13;41H│\e[13;75H│",
      "\e[14;41H└─────────────────────────────────┘"
    ].join)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tty-box-0.5.0 spec/unit/position_spec.rb