lib/physical/spec_support/factories/box_factory.rb in physical-0.1.4 vs lib/physical/spec_support/factories/box_factory.rb in physical-0.2.0
- old
+ new
@@ -2,12 +2,11 @@
require 'factory_bot'
FactoryBot.define do
factory :physical_box, class: "Physical::Box" do
- dimensions { [4, 5, 6] }
- dimension_unit { :dm }
- weight { 0.1 }
- weight_unit { :kg }
+ dimensions { [4, 5, 6].map { |d| Measured::Length(d, :dm) } }
+ inner_dimensions { dimensions.map { |d| d - Measured::Length(1, :cm) } }
+ weight { Measured::Weight(0.1, :kg) }
initialize_with { new(attributes) }
end
end