Sha256: 204bc8f584aacde7af8c2fcc644f47c9ff076f602183907613e91977aec158e5

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

require "helper"

module Neovim
  RSpec.describe Window do
    let(:client) { Neovim.attach_child(Support.child_argv) }
    let(:window) { client.current.window }

    before do
      client.command("normal ione")
      client.command("normal otwo")
      client.command("normal gg")
      client.command("vsplit")
    end

    describe "#buffer" do
      it "returns the window's buffer" do
        expect(window.buffer).to eq(client.get_current_buf)
      end
    end

    describe "#height", "#height=" do
      it "adjusts the window height" do
        expect do
          window.height -= 1
        end.to change { window.height }.by(-1)
      end
    end

    describe "#width", "#width=" do
      it "adjusts the window width" do
        expect do
          window.width -= 1
        end.to change { window.width }.by(-1)
      end
    end

    describe "#cursor", "#cursor=" do
      it "adjusts the window cursor" do
        expect do
          window.cursor = [2, 0]
        end.to change { window.cursor }.to([2, 0])
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
neovim-0.7.0 spec/neovim/window_spec.rb
neovim-0.6.2 spec/neovim/window_spec.rb
neovim-0.6.1 spec/neovim/window_spec.rb
neovim-0.6.0 spec/neovim/window_spec.rb