uh 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uh/version.rb +1 -1
- data/lib/uh/wm/client.rb +1 -1
- data/test/test_helper.rb +6 -0
- data/test/uh/wm/test_client.rb +173 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ef1227406e129065ec58d3ccbef8e530c74050f
|
4
|
+
data.tar.gz: 3fb7f59ba3e5c3853a0e5c0f488b031b0ce5362f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5898495c89370be4a3e77478bf49fc944051677aae34e38d653afe7a7012a9fc2276298de8ee77052b89566d1759724c16c4082582128d6be34ba305f53fd72c
|
7
|
+
data.tar.gz: 942d61b82d905b2bef029bd551db2709770b58a9ef4a308068d186a2e3b1aedadcf1bdecf3767be911c97bd7c83ba210734ac91313c18b4425b9d0d654fb84a8
|
data/lib/uh/version.rb
CHANGED
data/lib/uh/wm/client.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -0,0 +1,173 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
require 'test_helper'
|
3
|
+
require 'uh/wm'
|
4
|
+
|
5
|
+
module Uh
|
6
|
+
class WM
|
7
|
+
describe Client do
|
8
|
+
let(:geo) { Geo.new(0, 0, 1024, 768) }
|
9
|
+
let(:window) { OpenStruct.new(name: 'win name', wclass: 'win class') }
|
10
|
+
subject { Client.new(window) }
|
11
|
+
|
12
|
+
before { subject.geo = geo }
|
13
|
+
|
14
|
+
it 'is hidden' do
|
15
|
+
assert subject.hidden?
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '#name' do
|
19
|
+
it 'returns the window name' do
|
20
|
+
assert_equal 'win name', subject.name
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#wclass' do
|
25
|
+
it 'returns the window class' do
|
26
|
+
assert_equal 'win class', subject.wclass
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#update_window_properties' do
|
31
|
+
it 'updates the window name' do
|
32
|
+
window.name = 'new name'
|
33
|
+
assert_equal 'new name', subject.name
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'updates the window class' do
|
37
|
+
window.wclass = 'new class'
|
38
|
+
assert_equal 'new class', subject.wclass
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '#configure' do
|
43
|
+
let(:window) { Minitest::Mock.new }
|
44
|
+
|
45
|
+
before { window.expect :configure, window, [geo] }
|
46
|
+
|
47
|
+
it 'configures the window with client geo' do
|
48
|
+
subject.configure
|
49
|
+
window.verify
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'returns self' do
|
53
|
+
assert_same subject, subject.configure
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe '#moveresize' do
|
58
|
+
let(:window) { Minitest::Mock.new }
|
59
|
+
|
60
|
+
before { window.expect :moveresize, window, [geo] }
|
61
|
+
it 'moveresizes the window with client geo' do
|
62
|
+
subject.moveresize
|
63
|
+
window.verify
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'returns self' do
|
67
|
+
assert_same subject, subject.moveresize
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe '#show' do
|
72
|
+
let(:window) { Minitest::Mock.new }
|
73
|
+
|
74
|
+
before { window.expect :map, window }
|
75
|
+
|
76
|
+
it 'maps the window' do
|
77
|
+
subject.show
|
78
|
+
window.verify
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'is not hidden anymore' do
|
82
|
+
subject.show
|
83
|
+
refute subject.hidden?
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'returns self' do
|
87
|
+
assert_same subject, subject.show
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
describe '#hide' do
|
92
|
+
let(:window) { Minitest::Mock.new }
|
93
|
+
|
94
|
+
before { window.expect :unmap, window }
|
95
|
+
|
96
|
+
it 'unmaps the window' do
|
97
|
+
subject.hide
|
98
|
+
window.verify
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'is stays hidden' do
|
102
|
+
subject.hide
|
103
|
+
assert subject.hidden?
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'returns self' do
|
107
|
+
assert_same subject, subject.hide
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
describe '#focus' do
|
112
|
+
let(:window) { Minitest::Mock.new }
|
113
|
+
|
114
|
+
before do
|
115
|
+
window.expect :raise, window
|
116
|
+
window.expect :focus, window
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'raises and focuses the window' do
|
120
|
+
subject.focus
|
121
|
+
window.verify
|
122
|
+
end
|
123
|
+
|
124
|
+
it 'returns self' do
|
125
|
+
assert_same subject, subject.focus
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
describe '#kill' do
|
130
|
+
let(:window) { Minitest::Mock.new }
|
131
|
+
let(:protocols) { [] }
|
132
|
+
|
133
|
+
before { window.expect :icccm_wm_protocols, protocols }
|
134
|
+
|
135
|
+
it 'kills the window' do
|
136
|
+
window.expect :kill, window
|
137
|
+
subject.kill
|
138
|
+
window.verify
|
139
|
+
end
|
140
|
+
|
141
|
+
it 'returns self' do
|
142
|
+
window.expect :kill, window
|
143
|
+
assert_same subject, subject.kill
|
144
|
+
end
|
145
|
+
|
146
|
+
context 'when window supports icccm wm delete' do
|
147
|
+
let(:protocols) { [:WM_DELETE_WINDOW] }
|
148
|
+
|
149
|
+
it 'icccm deletes the window' do
|
150
|
+
window.expect :icccm_wm_delete, window
|
151
|
+
subject.kill
|
152
|
+
window.verify
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
describe '#kill!' do
|
158
|
+
let(:window) { Minitest::Mock.new }
|
159
|
+
|
160
|
+
before { window.expect :kill, window }
|
161
|
+
|
162
|
+
it 'kills the window' do
|
163
|
+
subject.kill!
|
164
|
+
window.verify
|
165
|
+
end
|
166
|
+
|
167
|
+
it 'returns self' do
|
168
|
+
assert_same subject, subject.kill!
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- test/test_helper.rb
|
110
110
|
- test/uh/test_geo.rb
|
111
111
|
- test/uh/test_wm.rb
|
112
|
+
- test/uh/wm/test_client.rb
|
112
113
|
- uh.gemspec
|
113
114
|
homepage: https://rubygems.org/gems/uh
|
114
115
|
licenses: []
|
@@ -137,4 +138,5 @@ test_files:
|
|
137
138
|
- test/test_helper.rb
|
138
139
|
- test/uh/test_geo.rb
|
139
140
|
- test/uh/test_wm.rb
|
141
|
+
- test/uh/wm/test_client.rb
|
140
142
|
has_rdoc:
|