Simplify cucumber X steps
This commit is contained in:
@@ -9,7 +9,7 @@ Feature: layout protocol
|
||||
end
|
||||
|
||||
def << client
|
||||
puts client
|
||||
puts "testing_#{client.name}"
|
||||
end
|
||||
end
|
||||
"""
|
||||
@@ -21,4 +21,4 @@ Feature: layout protocol
|
||||
Scenario: tells the layout to manage a client with #<< message
|
||||
Given uhwm is running with options -v -r./layout -l Layout
|
||||
When a window requests to be mapped
|
||||
Then the output must contain the window name
|
||||
Then the output must contain "testing_XClient/default"
|
||||
|
@@ -1,10 +1,10 @@
|
||||
Given /^a (\w+) window is mapped$/ do |ident|
|
||||
x_window_map ident: ident
|
||||
x_client(ident).map.sync
|
||||
end
|
||||
|
||||
Given /^a window is managed$/ do
|
||||
x_window_map
|
||||
uhwm_wait_output /manag.+#{x_window_name}/i
|
||||
x_client.map.sync
|
||||
uhwm_wait_output /manag.+#{x_client.name}/i
|
||||
end
|
||||
|
||||
When /^I press the ([^ ]+) keys?$/ do |keys|
|
||||
@@ -12,41 +12,41 @@ When /^I press the ([^ ]+) keys?$/ do |keys|
|
||||
end
|
||||
|
||||
When /^a window requests to be mapped$/ do
|
||||
x_window_map
|
||||
end
|
||||
|
||||
When /^the window requests to be unmapped$/ do
|
||||
x_window_unmap
|
||||
end
|
||||
|
||||
When /^the (\w+) window is unmapped$/ do |ident|
|
||||
x_window_unmap ident: ident
|
||||
uhwm_wait_output /unmanag.+#{x_client(ident: ident).name}/i
|
||||
x_client.map.sync
|
||||
end
|
||||
|
||||
When /^a window requests to be mapped (\d+) times$/ do |times|
|
||||
x_window_map times: times.to_i
|
||||
x_client.map times: times.to_i
|
||||
end
|
||||
|
||||
When /^the window requests to be unmapped$/ do
|
||||
x_client.unmap.sync
|
||||
end
|
||||
|
||||
When /^the (\w+) window is unmapped$/ do |ident|
|
||||
x_client(ident).unmap.sync
|
||||
uhwm_wait_output /unmanag.+#{x_client(ident).name}/i
|
||||
end
|
||||
|
||||
When /^the window is destroyed$/ do
|
||||
x_window_destroy
|
||||
x_client.destroy.sync
|
||||
end
|
||||
|
||||
Then /^it must connect to X display$/ do
|
||||
uhwm_wait_output 'Connected to'
|
||||
uhwm_wait_ready
|
||||
expect(x_socket_check uhwm.pid).to be true
|
||||
end
|
||||
|
||||
Then /^the window must be mapped$/ do
|
||||
expect(x_window_map_state).to eq 'IsViewable'
|
||||
expect(x_window_map_state x_client.window_id).to eq 'IsViewable'
|
||||
end
|
||||
|
||||
Then /^the (\w+) window must be mapped$/ do |ident|
|
||||
expect(x_window_map_state ident: ident).to eq 'IsViewable'
|
||||
expect(x_window_map_state x_client(ident).window_id).to eq 'IsViewable'
|
||||
end
|
||||
|
||||
Then /^the window must be focused$/ do
|
||||
expect(x_focused_window_id).to eq x_window_id
|
||||
expect(x_focused_window_id).to eq x_client.window_id
|
||||
end
|
||||
|
||||
Then /^the input event mask must include (.+)$/ do |mask|
|
||||
|
Reference in New Issue
Block a user