spec/csv2hash/validator_spec.rb in csv2hash-0.2.1 vs spec/csv2hash/validator_spec.rb in csv2hash-0.3.0
- old
+ new
@@ -8,32 +8,32 @@
definition.default!
end
end
describe '#message' do
- subject { Csv2hash.new double('definition', type: Csv2hash::Definition::COLLECTION), nil }
+ subject { Csv2hash::Main.new double('definition', type: Csv2hash::Definition::COLLECTION), nil }
context 'string value' do
let(:rule) { { foo: 'bar', message: ':foo are value of foo key' } }
it 'substitue value of key' do
- subject.send(:message, rule, nil, nil).should eql 'bar are value of foo key'
+ expect(subject.send(:message, rule, nil, nil)).to eql 'bar are value of foo key'
end
end
context 'array value' do
let(:rule) { { foo: ['bar', 'zone'], message: ':foo are values of foo key' } }
it 'substitue value of key' do
- subject.send(:message, rule, nil, nil).should eql '["bar", "zone"] are values of foo key'
+ expect(subject.send(:message, rule, nil, nil)).to eql '["bar", "zone"] are values of foo key'
end
end
context 'with position' do
let(:rule) { { message: 'value not found on :position' } }
it 'substitue value of key' do
- subject.send(:message, rule, 0, 2).should eql 'value not found on [0, 2]'
+ expect(subject.send(:message, rule, 0, 2)).to eql 'value not found on [0, 2]'
end
end
end
end