-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for that resize bug fixed a few commits ago
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
require_relative "spec_helper" | ||
require "remedy/frame" | ||
|
||
describe Remedy::Frame do | ||
let(:sizeclass) { ::Remedy::Tuple } | ||
let(:console_size) { sizeclass.new 6, 6 } | ||
subject(:f) do | ||
f0 = described_class.new name: "subject" | ||
f0.available_size = console_size | ||
f0.arrangement = :stacked | ||
f0 | ||
end | ||
|
||
before do | ||
f << "foo" | ||
f << "bar\nbaz" | ||
end | ||
|
||
xit "occupies the size specified" do | ||
f.size = Tuple 5, 5 | ||
actual = f.to_s | ||
expect(actual).to eq "???" | ||
end | ||
|
||
describe "#resize" do | ||
let(:new_size) { sizeclass.new 5, 5 } | ||
|
||
before do | ||
f.size = :fill | ||
end | ||
|
||
it "it resizes the buffer" do | ||
f.compile_contents | ||
expect(f.compute_actual_size).to eq console_size | ||
f.available_size = new_size | ||
expect(f.compute_actual_size).to eq new_size | ||
f.compile_contents # buffer size is not updated until recompile | ||
expect(f.buffer.size).to eq new_size | ||
end | ||
end | ||
end |