diff --git a/spec/producer/core/action_spec.rb b/spec/producer/core/action_spec.rb index 2819bfc..a4cfbd7 100644 --- a/spec/producer/core/action_spec.rb +++ b/spec/producer/core/action_spec.rb @@ -3,7 +3,9 @@ require 'spec_helper' module Producer::Core describe Action do let(:env) { double 'env'} - subject(:action) { described_class.new(env) } + let(:arguments) { [:some, :arguments] } + let(:options) { { foo: :bar } } + subject(:action) { described_class.new(env, *arguments, options) } it_behaves_like 'action' @@ -22,5 +24,23 @@ module Producer::Core expect(action.name).to eq 'action' end end + + describe '#to_s' do + it 'includes action name' do + expect(action.to_s).to match /\A#{action.name}/ + end + + it 'includes arguments inspection' do + expect(action.to_s).to match /#{Regexp.quote(arguments.inspect)}\z/ + end + + context 'when arguments inspection is very long' do + let(:arguments) { [:some, :arguments] * 32 } + + it 'summarizes arguments inspection' do + expect(action.to_s.length).to be < 70 + end + end + end end end diff --git a/spec/support/shared_action.rb b/spec/support/shared_action.rb index 7177107..80ae13a 100644 --- a/spec/support/shared_action.rb +++ b/spec/support/shared_action.rb @@ -41,23 +41,5 @@ module Producer::Core expect(action.name).to match /\A\w+\z/ end end - - describe '#to_s' do - it 'includes action name' do - expect(action.to_s).to match /\A#{action.name}/ - end - - it 'includes arguments inspection' do - expect(action.to_s).to match /#{Regexp.quote(arguments.inspect)}\z/ - end - - context 'when arguments inspection is very long' do - let(:arguments) { [:some, :arguments] * 32 } - - it 'summarizes arguments inspection' do - expect(action.to_s.length).to be < 70 - end - end - end end end