spec/unit/padding_spec.rb in tty-box-0.4.1 vs spec/unit/padding_spec.rb in tty-box-0.5.0
- old
+ new
@@ -1,7 +1,21 @@
# frozen_string_literal: true
-RSpec.describe TTY::Box, ':padding option' do
+RSpec.describe TTY::Box, ":padding option" do
+ it "padds internal content without width and height" do
+ box = TTY::Box.frame(padding: 1) do
+ "Drawing a box in terminal emulator"
+ end
+
+ expect(box).to eq([
+ "┌────────────────────────────────────┐\n",
+ "│ │\n",
+ "│ Drawing a box in terminal emulator │\n",
+ "│ │\n",
+ "└────────────────────────────────────┘\n"
+ ].join)
+ end
+
it "padds internal content without position arguments" do
box = TTY::Box.frame(width: 30, height: 6, padding: 1) do
"Drawing a box in terminal emulator"
end