From 4603ce777f32200bf42b25ecffc9ceed09d41905 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Sun, 19 Jan 2014 23:41:27 +0000 Subject: [PATCH] Make Remote#hostname attribute read-only --- lib/producer/core/remote.rb | 2 +- spec/producer/core/remote_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/producer/core/remote.rb b/lib/producer/core/remote.rb index 12f77a4..5bbec64 100644 --- a/lib/producer/core/remote.rb +++ b/lib/producer/core/remote.rb @@ -4,7 +4,7 @@ module Producer require 'etc' require 'net/ssh' - attr_accessor :hostname + attr_reader :hostname def initialize(hostname) @hostname = hostname diff --git a/spec/producer/core/remote_spec.rb b/spec/producer/core/remote_spec.rb index a95c7ce..a560dc8 100644 --- a/spec/producer/core/remote_spec.rb +++ b/spec/producer/core/remote_spec.rb @@ -5,8 +5,8 @@ module Producer::Core let(:hostname) { 'some_host.example' } subject(:remote) { Remote.new(hostname) } - describe '#hostname' do - it 'returns the assignated hostname' do + describe '#initialize' do + it 'assigns the given hostname' do expect(remote.hostname).to eq hostname end end