Sha256: fead324757de38623080a6a1fc16cd8e8f95b801ce2ff0d4b502f40ead70503a

Contents?: true

Size: 1.1 KB

Versions: 11

Compression:

Stored size: 1.1 KB

Contents

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

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

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

  it 'should implement #to_selected_set' do
    enum, set = @operand.to_selected_set
    enum.should be_respond_to(:to_set_enum)
    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::Mixin::LARGEST_SET_BOUND)).should_not(
      be_true)
    enum.each do |element|
      set_var = element.to_set_var
      ((set_var.lower_bound == []) && 
       (set_var.upper_bound == Gecode::Mixin::LARGEST_SET_BOUND)).should_not(
        be_true)
    end
  end

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

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
gecoder-with-gecode-1.1.1.1 specs/selected_set.rb
gecoder-with-gecode-1.1.1 specs/selected_set.rb
gecoder-1.1.1 specs/selected_set.rb
gecoder-with-gecode-1.1.0 specs/selected_set.rb
gecoder-1.1.0 specs/selected_set.rb
gecoder-0.9.1 specs/selected_set.rb
gecoder-1.0.0 specs/selected_set.rb
gecoder-with-gecode-0.9.1-x86-mswin32-60 specs/selected_set.rb
gecoder-with-gecode-0.9.1 specs/selected_set.rb
gecoder-with-gecode-1.0.0-x86-mswin32-60 specs/selected_set.rb
gecoder-with-gecode-1.0.0 specs/selected_set.rb