Make Remote#hostname attribute read-only
This commit is contained in:
parent
b1e182cc93
commit
4603ce777f
@ -4,7 +4,7 @@ module Producer
|
|||||||
require 'etc'
|
require 'etc'
|
||||||
require 'net/ssh'
|
require 'net/ssh'
|
||||||
|
|
||||||
attr_accessor :hostname
|
attr_reader :hostname
|
||||||
|
|
||||||
def initialize(hostname)
|
def initialize(hostname)
|
||||||
@hostname = hostname
|
@hostname = hostname
|
||||||
|
@ -5,8 +5,8 @@ module Producer::Core
|
|||||||
let(:hostname) { 'some_host.example' }
|
let(:hostname) { 'some_host.example' }
|
||||||
subject(:remote) { Remote.new(hostname) }
|
subject(:remote) { Remote.new(hostname) }
|
||||||
|
|
||||||
describe '#hostname' do
|
describe '#initialize' do
|
||||||
it 'returns the assignated hostname' do
|
it 'assigns the given hostname' do
|
||||||
expect(remote.hostname).to eq hostname
|
expect(remote.hostname).to eq hostname
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user