From 705774f8efc22e78896b8848b7cd0b374d5d6c5e Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Sun, 19 Jan 2014 19:08:55 +0000 Subject: [PATCH] Add Remote::Environment#variables attribute reader --- lib/producer/core/remote/environment.rb | 2 ++ spec/producer/core/remote/environment_spec.rb | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/producer/core/remote/environment.rb b/lib/producer/core/remote/environment.rb index 40e9ce2..b78c049 100644 --- a/lib/producer/core/remote/environment.rb +++ b/lib/producer/core/remote/environment.rb @@ -17,6 +17,8 @@ module Producer extend Forwardable def_delegator :@variables, :key? + attr_reader :variables + def initialize(variables) @variables = variables end diff --git a/spec/producer/core/remote/environment_spec.rb b/spec/producer/core/remote/environment_spec.rb index 656e03e..1cc366a 100644 --- a/spec/producer/core/remote/environment_spec.rb +++ b/spec/producer/core/remote/environment_spec.rb @@ -28,7 +28,7 @@ module Producer::Core describe '#initialize' do it 'assigns the key/value pairs' do - expect(environment.instance_eval { @variables }).to eq variables + expect(environment.variables).to eq variables end end @@ -36,8 +36,7 @@ module Producer::Core let(:key) { 'SOME_KEY' } it 'forwards the message to @variables' do - expect(environment.instance_eval { @variables }) - .to receive(:key?).with(key) + expect(environment.variables).to receive(:key?).with(key) environment.key? key end end