Implement Client#moveresize

This commit is contained in:
Thibault Jouan 2015-04-16 18:16:49 +00:00
parent 417eaecad9
commit 5351307cdc
2 changed files with 20 additions and 1 deletions

View File

@ -20,6 +20,11 @@ module Uh
def wclass
@wclass ||= @window.wclass
end
def moveresize
@window.moveresize @geo
self
end
end
end
end

View File

@ -2,7 +2,10 @@ module Uh
module WM
RSpec.describe Client do
let(:geo) { Geo.new(0, 0, 640, 480) }
let(:window) { double 'window', to_s: 'wid', name: 'wname', wclass: 'wclass' }
let(:window) do
instance_spy Window, 'window', to_s: 'wid',
name: 'wname', wclass: 'wclass'
end
subject(:client) { described_class.new window, geo }
describe '#to_s' do
@ -34,6 +37,17 @@ module Uh
expect(client.wclass).to eq window.wclass
end
end
describe '#moveresize' do
it 'moveresizes the window with client geo' do
expect(window).to receive(:moveresize).with geo
client.moveresize
end
it 'returns self' do
expect(client.moveresize).to be client
end
end
end
end
end