spec/identification_scheme/identification_spec.rb in activefacts-api-0.9.7 vs spec/identification_scheme/identification_spec.rb in activefacts-api-0.9.8
- old
+ new
@@ -35,11 +35,11 @@
class Cat
identified_by :name
has_one :name
end
end
- end.should raise_error
+ end.should raise_error(ActiveFacts::API::InvalidIdentificationException)
end
describe "when asserted" do
before :each do
@bus = @c.Business
@@ -82,11 +82,11 @@
end
it "should fail if the new value already exists" do
proc do
@fly.name = 'Acme'
- end.should raise_error
+ end.should raise_error(ActiveFacts::API::DuplicateIdentifyingValueException)
end
it "should not fail if the new value is self" do
lambda { @bus.name = 'Acme' }.should_not raise_error
end
@@ -232,11 +232,11 @@
identified_by :building, :number
has_one :building
one_to_one :number # Error, invalid identifier
end
end
- end.should raise_error
+ end.should raise_error(ActiveFacts::API::InvalidIdentificationException)
end
describe "when asserted" do
before :each do
@b = @c.Building('Mackay')
@@ -292,11 +292,11 @@
@or = @c.OwnerRoom(@o, @r)
end
it "should fail if the new value already exists" do
@c.Room(@b, 102)
- lambda { @r.number = 102 }.should raise_error
+ lambda { @r.number = 102 }.should raise_error(ActiveFacts::API::DuplicateIdentifyingValueException)
end
describe "to a previously-nonexistent value" do
before :each do
@r.number = 103
@@ -335,9 +335,10 @@
it "should not be found in the constellation using the old value" do
@c.Room.keys[0].should_not == [['Mackay'],101]
end
it "the old value's back-reference is set to nil" do
+ # @rn.all_room.should_not include @r
@rn.all_room.to_a.should_not include @r
end
#describe "and the old identifying value plays no other roles" do
# describe "and the player of the identifying role is not independent" do