Add basic Client class

This commit is contained in:
Thibault Jouan
2015-04-16 11:57:48 +00:00
parent fe47e27d98
commit 6e90225c9d
3 changed files with 64 additions and 0 deletions

39
spec/uh/wm/client_spec.rb Normal file
View File

@@ -0,0 +1,39 @@
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' }
subject(:client) { described_class.new window, geo }
describe '#to_s' do
it 'includes window name' do
expect(client.to_s).to include 'wname'
end
it 'includes window class' do
expect(client.to_s).to include 'wclass'
end
it 'includes geo' do
expect(client.to_s).to include geo.to_s
end
it 'includes window id' do
expect(client.to_s).to include 'wid'
end
end
describe '#wname' do
it 'returns the window name' do
expect(client.wname).to eq window.name
end
end
describe '#wclass' do
it 'returns the window class' do
expect(client.wclass).to eq window.wclass
end
end
end
end
end