spec/attribute_spec.rb in attributor-5.2.1 vs spec/attribute_spec.rb in attributor-5.3
- old
+ new
@@ -311,10 +311,14 @@
context 'load' do
let(:context) { ['context'] }
let(:value) { '1' }
it 'delegates to type.load' do
- expect(type).to receive(:load).with(value, context, {})
+ # Need to add the "anything" of the 3rd element, as in ruby < 2.7 it comes as an empty hash
+ expect(type).to receive(:load) do |v, c, _other|
+ expect(v).to eq(value)
+ expect(c).to eq(context)
+ end
attribute.load(value, context)
end
it 'passes options to type.load' do
expect(type).to receive(:load).with(value, context, foo: 'bar')