Implement Client#focus

This commit is contained in:
Thibault Jouan 2015-04-16 18:42:25 +00:00
parent 3cf62cc07d
commit b4240a8b4f
2 changed files with 22 additions and 0 deletions

View File

@ -48,6 +48,12 @@ module Uh
@unmap_count += 1
self
end
def focus
@window.raise
@window.focus
self
end
end
end
end

View File

@ -101,6 +101,22 @@ module Uh
expect(client.hide).to be client
end
end
describe '#focus' do
it 'raises the window' do
expect(window).to receive :raise
client.focus
end
it 'focuses the window' do
expect(window).to receive :focus
client.focus
end
it 'returns self' do
expect(client.focus).to be client
end
end
end
end
end