Implement basic Testing::MockRemote object

This commit is contained in:
Thibault Jouan 2014-03-04 05:32:15 +00:00
parent 88036f0389
commit b576604498
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1 @@
require 'producer/core/testing/mock_remote'

View File

@ -0,0 +1,11 @@
module Producer
module Core
module Testing
class MockRemote < Remote
def session
raise 'no session for mock remote!'
end
end
end
end
end

View File

@ -0,0 +1,19 @@
require 'producer/core/testing'
module Producer::Core
module Testing
describe MockRemote do
subject(:remote) { MockRemote.new('some_host.example') }
it 'is a remote' do
expect(remote).to be_a Remote
end
describe '#session' do
it 'raises an error to prevent real session usage' do
expect { remote.session }.to raise_error
end
end
end
end
end