Implement action arguments logging

This commit is contained in:
Thibault Jouan
2014-09-17 00:22:05 +00:00
parent 3cb195c9a0
commit 563bf9cccf
4 changed files with 39 additions and 8 deletions

View File

@@ -54,8 +54,20 @@ module Producer::Core
end
describe '#to_s' do
it 'returns a word' do
expect(action.to_s).to eq action.name
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