spec/csv2hash/validator_spec.rb in csv2hash-0.6.4 vs spec/csv2hash/validator_spec.rb in csv2hash-0.6.5

- old
+ new

@@ -11,29 +11,29 @@ include Validator end.new end context 'string value' do - let(:rules) {{ foo: 'bar', message: ':foo are value of foo key' }} + let(:rules) {{ foo: 'bar', message: ':foo are value of foo key', key: 'bar' }} it 'substitue value of key' do - expect(subject.send(:message, cell, nil, nil)).to eql 'bar are value of foo key' + expect(subject.send(:message, cell, nil, nil, 'foo')).to eql 'bar are value of foo key' end end context 'array value' do let(:rules) { { foo: ['bar', 'zone'], message: ':foo are values of foo key' } } it 'substitue value of key' do - expect(subject.send(:message, cell, nil, nil)).to eql '["bar", "zone"] are values of foo key' + expect(subject.send(:message, cell, nil, nil, nil)).to eql '["bar", "zone"] are values of foo key' end end context 'with position' do let(:rules) { { message: 'value not found on :position' } } it 'substitue value of key' do - expect(subject.send(:message, cell, 0, 2)).to eql 'value not found on [0, 2]' + expect(subject.send(:message, cell, 0, 2, nil)).to eql 'value not found on [0, 2]' end end end end