specs/constraints/reification_sugar.rb in gecoder-0.8.2 vs specs/constraints/reification_sugar.rb in gecoder-0.8.3

- old
+ new

@@ -24,32 +24,10 @@ it 'should fail disjunctions if neither side can be satisfied' do (@x.must == 3) | (@y.must == 3) @model.solve!.should be_nil end - it 'should translate disjunctions' do - Gecode::Raw.should_receive(:rel).once.with( - an_instance_of(Gecode::Raw::Space), - an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::BOT_OR, - an_instance_of(Gecode::Raw::BoolVar), - an_instance_of(Gecode::Raw::BoolVar), - Gecode::Raw::ICL_DEF, Gecode::Raw::PK_DEF - ) - 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::PK_DEF) - 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, - Gecode::Raw::PK_DEF) - (@x.must > 0) | (@y.must == 3) - sol = @model.solve! - end - it 'should solve disjunctions' do (@x.must > 0) | (@y.must == 3) sol = @model.solve! sol.should_not be_nil sol.x.should have_domain([1]) @@ -57,33 +35,11 @@ it 'should fail conjunctions if one side can\'t be satisfied' do (@x.must > 3) & (@y.must == 3) @model.solve!.should be_nil end - - it 'should translate conjunctions' do - Gecode::Raw.should_receive(:rel).once.with( - an_instance_of(Gecode::Raw::Space), - an_instance_of(Gecode::Raw::BoolVar), Gecode::Raw::BOT_AND, - an_instance_of(Gecode::Raw::BoolVar), - an_instance_of(Gecode::Raw::BoolVar), - Gecode::Raw::ICL_DEF, Gecode::Raw::PK_DEF - ) - 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::PK_DEF) - 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, - Gecode::Raw::PK_DEF) - (@x.must > 0) & (@y.must == 2) - sol = @model.solve! - end - + it 'should solve conjunctions' do (@x.must > 0) & (@y.must == 2) sol = @model.solve! sol.should_not be_nil sol.x.should have_domain([1]) @@ -109,6 +65,6 @@ it 'should handle negations' do (@z.must_not == 4) & (@z.must == 4) sol = @model.solve! sol.should be_nil end -end \ No newline at end of file +end