Implement Client#update_window_properties

This commit is contained in:
Thibault Jouan 2015-04-22 03:18:19 +00:00
parent fb4af963eb
commit 03a6c323ac
2 changed files with 23 additions and 0 deletions

View File

@ -31,6 +31,11 @@ module Uh
@wclass ||= @window.wclass
end
def update_window_properties
@wname = @window.name
@wclass = @window.wclass
end
def configure
@window.configure @geo
self

View File

@ -47,6 +47,24 @@ module Uh
end
end
describe '#update_window_properties' do
it 'updates the cached window name' do
client.name
allow(window).to receive(:name) { 'new name' }
expect { client.update_window_properties }
.to change { client.name }
.from('wname').to 'new name'
end
it 'updates the cached window class' do
client.wclass
allow(window).to receive(:wclass) { 'new class' }
expect { client.update_window_properties }
.to change { client.wclass }
.from('wclass').to 'new class'
end
end
describe '#configure' do
it 'configures the window with client geo' do
expect(window).to receive(:configure).with geo