specs/constraints/reification_sugar.rb in gecoder-0.5.0 vs specs/constraints/reification_sugar.rb in gecoder-0.6.0
- old
+ new
@@ -25,14 +25,16 @@
(@x.must == 3) | (@y.must == 3)
@model.solve!.should be_nil
end
it 'should translate disjunctions' do
- Gecode::Raw.should_receive(:rel).once.with(@model.active_space,
+ Gecode::Raw.should_receive(:rel).once.with(
+ an_instance_of(Gecode::Raw::Space),
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_GR, 0,
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF)
- Gecode::Raw.should_receive(:rel).once.with(@model.active_space,
+ Gecode::Raw.should_receive(:rel).once.with(
+ an_instance_of(Gecode::Raw::Space),
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_EQ, 3,
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF)
(@x.must > 0) | (@y.must == 3)
sol = @model.solve!
end
@@ -48,13 +50,15 @@
(@x.must > 3) & (@y.must == 3)
@model.solve!.should be_nil
end
it 'should translate conjunctions' do
- Gecode::Raw.should_receive(:rel).once.with(@model.active_space,
+ Gecode::Raw.should_receive(:rel).once.with(
+ an_instance_of(Gecode::Raw::Space),
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_GR, 0,
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF)
- Gecode::Raw.should_receive(:rel).once.with(@model.active_space,
+ Gecode::Raw.should_receive(:rel).once.with(
+ an_instance_of(Gecode::Raw::Space),
an_instance_of(Gecode::Raw::IntVar), Gecode::Raw::IRT_EQ, 2,
an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::ICL_DEF)
(@x.must > 0) & (@y.must == 2)
sol = @model.solve!
end
\ No newline at end of file