Simplify actions specs
This commit is contained in:
parent
35621e1f5f
commit
fe1eb5bc1a
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user