Fix X display handling in rspec test suite
* Hide any available X display from test suite context; * Ensure the manager never connect or block.
This commit is contained in:
parent
59e9562279
commit
c9e6d1807b
@ -10,4 +10,9 @@ RSpec.configure do |config|
|
|||||||
end
|
end
|
||||||
|
|
||||||
config.disable_monkey_patching!
|
config.disable_monkey_patching!
|
||||||
|
|
||||||
|
config.before :all do
|
||||||
|
# Ensure current X display is not available from rspec test suite.
|
||||||
|
ENV.delete 'DISPLAY'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -15,8 +15,7 @@ module Uh
|
|||||||
described_class.run arguments, stdout: stdout, stderr: stderr
|
described_class.run arguments, stdout: stdout, stderr: stderr
|
||||||
end
|
end
|
||||||
|
|
||||||
# FIXME: remove this hack we currently need to prevent the Runner from
|
# Prevent Runner from connecting a Manager and blocking.
|
||||||
# blocking.
|
|
||||||
before { allow(Runner).to receive :run }
|
before { allow(Runner).to receive :run }
|
||||||
|
|
||||||
it 'builds a new CLI with given arguments' do
|
it 'builds a new CLI with given arguments' do
|
||||||
|
@ -14,6 +14,9 @@ module Uh
|
|||||||
describe '#connect' do
|
describe '#connect' do
|
||||||
let(:block) { proc { } }
|
let(:block) { proc { } }
|
||||||
|
|
||||||
|
# Prevent Manager to open a real display.
|
||||||
|
before { allow(display).to receive :open }
|
||||||
|
|
||||||
it 'opens the display' do
|
it 'opens the display' do
|
||||||
expect(manager.display).to receive :open
|
expect(manager.display).to receive :open
|
||||||
manager.connect
|
manager.connect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user