Simplify actions specs
This commit is contained in:
parent
35621e1f5f
commit
fe1eb5bc1a
@ -2,15 +2,11 @@ require 'spec_helper'
|
|||||||
|
|
||||||
module Producer::Core
|
module Producer::Core
|
||||||
describe Actions::Echo do
|
describe Actions::Echo do
|
||||||
let(:env) { Env.new }
|
let(:env) { double 'env' }
|
||||||
let(:text) { 'hello' }
|
let(:text) { 'hello' }
|
||||||
subject(:echo) { Actions::Echo.new(env, text) }
|
subject(:echo) { Actions::Echo.new(env, text) }
|
||||||
|
|
||||||
describe '#apply' do
|
describe '#apply' do
|
||||||
before do
|
|
||||||
env.output = StringIO.new
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'outputs the string given as argument through env.output' do
|
it 'outputs the string given as argument through env.output' do
|
||||||
expect(env).to receive(:output).with(text)
|
expect(env).to receive(:output).with(text)
|
||||||
echo.apply
|
echo.apply
|
||||||
|
@ -8,9 +8,7 @@ module Producer::Core
|
|||||||
subject(:sh) { Actions::ShellCommand.new(env, command) }
|
subject(:sh) { Actions::ShellCommand.new(env, command) }
|
||||||
|
|
||||||
describe '#apply' do
|
describe '#apply' do
|
||||||
before do
|
before { env.output = StringIO.new }
|
||||||
env.output = StringIO.new
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'delegates the call to env.remote.execute method' do
|
it 'delegates the call to env.remote.execute method' do
|
||||||
expect(env.remote).to receive(:execute).with(command)
|
expect(env.remote).to receive(:execute).with(command)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user