spec/absorption_spec.rb in activefacts-0.7.2 vs spec/absorption_spec.rb in activefacts-0.7.3
- old
+ new
@@ -10,15 +10,15 @@
require 'activefacts/persistence'
describe "Absorption" do
Prologue = %Q{
vocabulary Test;
- DateTime is defined as DateAndTime();
- Month is defined as VariableLengthText(3);
- Season is defined as VariableLengthText(6);
- PartyID is defined as AutoCounter();
- ClaimID is defined as AutoCounter();
+ DateTime is written as DateAndTime();
+ Month is written as VariableLengthText(3);
+ Season is written as VariableLengthText(6);
+ PartyID is written as AutoCounter();
+ ClaimID is written as AutoCounter();
}
Claim = %Q{
Claim is identified by ClaimID where
Claim has exactly one ClaimID,
ClaimID is of at most one Claim;
@@ -49,11 +49,11 @@
{ :should => "absorb a one-to-one along the identification path",
:cql => %Q{
#{Prologue} #{Claim} #{Incident}
Incident relates to loss on exactly one DateTime;
},
- :tables => { "Claim" => ["ClaimID", %w{Incident DateTime}]}
+ :tables => { "Claim" => [%w{Claim ID}, %w{Incident Date Time}]}
},
{ :should => "absorb an objectified binary with single-role UC",
:cql => %Q{
#{Prologue} #{Claim} #{Party} #{Person}
@@ -61,18 +61,15 @@
Claim was lodged by at most one Person;
Lodgement was made at at most one DateTime;
Person has exactly one birth-Date;
},
:tables => {
- "Claim" => ["ClaimID", %w{Lodgement DateTime}, %w{Lodgement Person ID}],
- "Party" => ["PartyID", %w{Person Birth Date}]
+ "Claim" => [%w{Claim ID}, %w{Lodgement Date Time}, %w{Lodgement Person ID}],
+ "Party" => [%w{Party ID}, %w{Person Birth Date}]
}
},
]
-
- setup do
- end
Tests.each do |test|
should = test[:should]
cql = test[:cql]
expected_tables = test[:tables]