Sha256: 12567d572298f53cc666990f7300c6de5693fd47d3ff424201d8422a626ec287

Contents?: true

Size: 927 Bytes

Versions: 3

Compression:

Stored size: 927 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe Gecode::SelectedSet::SelectedSetOperand do
  before do
    @model = Gecode::Model.new
    @set = @model.set_var([], 0..4)
    @operand = Gecode::SetElements::SetElementsOperand.new(@set)
  end

  it 'should implement #model' do
    @operand.model.should be_kind_of(Gecode::Model)
  end

  it 'should implement #to_set_elements' do
    set = @operand.to_set_elements
    set.should be_respond_to(:to_set_var)
    @model.solve!
    set_var = set.to_set_var
    ((set_var.lower_bound == []) && 
     (set_var.upper_bound == Gecode::Model::LARGEST_SET_BOUND)).should_not(
      be_true)
  end

  it 'should implement #must' do
    receiver = @operand.must
    receiver.should be_kind_of(
      Gecode::SetElements::SetElementsConstraintReceiver)
  end

  it 'should be produces by SetOperand#elements' do
    @set.elements.should be_respond_to(:to_set_elements)
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
gecoder-0.9.0 specs/set_elements.rb
gecoder-with-gecode-0.9.0-x86-mswin32-60 specs/set_elements.rb
gecoder-with-gecode-0.9.0 specs/set_elements.rb