From 921fc8d3f934485f20233835720770140835687f Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Thu, 19 Dec 2013 22:04:15 +0000 Subject: [PATCH] Refactor Remote::Environment spec --- spec/producer/core/remote/environment_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/producer/core/remote/environment_spec.rb b/spec/producer/core/remote/environment_spec.rb index 82b515a..78998cf 100644 --- a/spec/producer/core/remote/environment_spec.rb +++ b/spec/producer/core/remote/environment_spec.rb @@ -3,7 +3,9 @@ require 'spec_helper' module Producer::Core describe Remote::Environment do let(:variables) { { 'FOO' => 'bar', 'BAZ' => 'qux' } } - subject(:environment) { Remote::Environment.new(variables) } + let(:string) { "FOO=bar\nBAZ=qux" } + let(:argument) { variables } + subject(:environment) { Remote::Environment.new(argument) } describe '#initialize' do context 'when a hash is given' do @@ -13,7 +15,7 @@ module Producer::Core end context 'when a string is given' do - subject(:environment) { Remote::Environment.new("FOO=bar\nBAZ=qux") } + let(:argument) { string } it 'assigns the key/value pairs' do expect(environment.instance_eval { @variables }).to eq variables