Simplify actions specs

This commit is contained in:
Thibault Jouan 2013-12-19 20:34:46 +00:00
parent 35621e1f5f
commit fe1eb5bc1a
2 changed files with 2 additions and 8 deletions

View File

@ -2,15 +2,11 @@ require 'spec_helper'
module Producer::Core
describe Actions::Echo do
let(:env) { Env.new }
let(:env) { double 'env' }
let(:text) { 'hello' }
subject(:echo) { Actions::Echo.new(env, text) }
describe '#apply' do
before do
env.output = StringIO.new
end
it 'outputs the string given as argument through env.output' do
expect(env).to receive(:output).with(text)
echo.apply

View File

@ -8,9 +8,7 @@ module Producer::Core
subject(:sh) { Actions::ShellCommand.new(env, command) }
describe '#apply' do
before do
env.output = StringIO.new
end
before { env.output = StringIO.new }
it 'delegates the call to env.remote.execute method' do
expect(env.remote).to receive(:execute).with(command)