specs/int_var.rb in gecoder-0.5.0 vs specs/int_var.rb in gecoder-0.6.0
- old
+ new
@@ -13,17 +13,17 @@
@var.size.should equal(@domain.size)
end
it 'should contain every element in its domain' do
@domain.each do |i|
- @var.should be_in(i)
+ @var.should include(i)
end
end
it 'should not contain elements outside its domain' do
- @var.should_not be_in(@domain.min - 1)
- @var.should_not be_in(@domain.max + 1)
+ @var.should_not include(@domain.min - 1)
+ @var.should_not include(@domain.max + 1)
end
it 'should have a width equal to the domain width' do
@var.width.should equal(@domain.max - @domain.min + 1)
end
@@ -52,10 +52,14 @@
end
it 'should have a range domain' do
@var.should be_range
end
+
+ it 'should raise error when trying to access assigned value' do
+ lambda{ @var.value }.should raise_error(RuntimeError)
+ end
end
describe Gecode::FreeIntVar, ' (defined with three-dot range)' do
before do
@range = -4...3
@@ -83,10 +87,10 @@
it 'should not be a range domain' do
@var.should_not be_range
end
it 'should not contain the domain\'s holes' do
- @var.should_not be_in(0)
+ @var.should_not include(0)
end
end
describe Gecode::FreeIntVar, ' (with a domain of size 1)' do
before do
\ No newline at end of file