From f15fa116c936f726414d437a71fb5e1607a2eb71 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Mon, 20 Apr 2015 07:14:55 +0000 Subject: [PATCH] Rename Manager#manage as Manager#map --- lib/uh/wm/manager.rb | 4 ++-- spec/uh/wm/manager_spec.rb | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/uh/wm/manager.rb b/lib/uh/wm/manager.rb index e056b4e..8192a93 100644 --- a/lib/uh/wm/manager.rb +++ b/lib/uh/wm/manager.rb @@ -55,7 +55,7 @@ module Uh end end - def manage window + def map window return if window.override_redirect? || client_for(window) @clients << client = Client.new(window) @events.emit :manage, args: client @@ -94,7 +94,7 @@ module Uh end def handle_map_request event - manage event.window + map event.window end def client_for window diff --git a/spec/uh/wm/manager_spec.rb b/spec/uh/wm/manager_spec.rb index dc0c807..c7f382f 100644 --- a/spec/uh/wm/manager_spec.rb +++ b/spec/uh/wm/manager_spec.rb @@ -126,7 +126,7 @@ module Uh end context 'with known window' do - before { manager.manage window } + before { manager.map window } it 'tells the client to configure' do expect(manager.clients[0]).to receive :configure @@ -135,22 +135,22 @@ module Uh end end - describe '#manage' do + describe '#map' do it 'registers a new client wrapping the given window' do - manager.manage window + manager.map window expect(manager.clients[0]) .to be_a(Client) .and have_attributes(window: window) end it 'registers new client only once for a given window' do - manager.manage window - expect { manager.manage window }.not_to change { manager.clients } + manager.map window + expect { manager.map window }.not_to change { manager.clients } end it 'ignores event when window has override redirect' do allow(window).to receive(:override_redirect?) { true } - expect { manager.manage window }.not_to change { manager.clients } + expect { manager.map window }.not_to change { manager.clients } end it 'emits :manage event with the registered client' do @@ -160,7 +160,7 @@ module Uh .to be_a(Client) .and have_attributes(window: window) end - manager.manage window + manager.map window end end @@ -236,8 +236,8 @@ module Uh context 'when map_request event is given' do let(:event) { double 'event', type: :map_request, window: :window } - it 'manages the event window' do - expect(manager).to receive(:manage).with :window + it 'maps the event window' do + expect(manager).to receive(:map).with :window manager.handle event end end