activefacts 0.8.8 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,10 +14,12 @@ describe "Sample data" do
14
14
  vocabulary V;
15
15
 
16
16
  Company Name is written as String;
17
+ Date is written as Date;
17
18
  Company is identified by its Name;
18
19
  Person is identified by its Name where Person is called Person Name;
19
20
  Directorship is where
20
21
  Company is directed by Person;
22
+ Directorship began on appointment-Date;
21
23
  }
22
24
 
23
25
  GoodSamples = [
@@ -75,9 +77,13 @@ describe "Sample data" do
75
77
  ],
76
78
 
77
79
  # Objectification examples
78
- [ # Same in a named population
80
+ [
79
81
  "Directorship (where Company 'Microsoft' is directed by Person 'Gates');",
80
- :pending # [{:facts=>Set["Company has Company Name 'Microsoft'", "Company is directed by Person", "Person is called Person Name 'Gates'"], :instances=>Set["Company is identified by Company Name where Company has Company Name 'Microsoft'", "Company Name 'Microsoft'", "Directorship where Company is directed by Person", "Person is identified by Person Name where Person is called Person Name 'Gates'", "Person Name 'Gates'"]}]
82
+ [{:facts=>Set["Company has Company Name 'Microsoft'", "Company is directed by Person", "Person is called Person Name 'Gates'"], :instances=>Set["Person is identified by Person Name where Person is called Person Name 'Gates'", "Company is identified by Company Name where Company has Company Name 'Microsoft'", "Company Name 'Microsoft'", "Directorship where Company is directed by Person", "Person Name 'Gates'"]}]
83
+ ],
84
+ [
85
+ "Directorship (where Company 'Microsoft' is directed by Person 'Gates') began on appointment Date '20/02/1981';",
86
+ [{:facts=>Set["Company has Company Name 'Microsoft'", "Company is directed by Person", "Directorship began on appointment-Date '20/02/1981'", "Person is called Person Name 'Gates'"], :instances=>Set["Person is identified by Person Name where Person is called Person Name 'Gates'", "Company is identified by Company Name where Company has Company Name 'Microsoft'", "Company Name 'Microsoft'", "Directorship where Company is directed by Person", "Person Name 'Gates'", "Date '20/02/1981'"]}]
81
87
  ],
82
88
  ]
83
89
 
@@ -160,9 +166,18 @@ describe "Sample data" do
160
166
 
161
167
  it "should handle #{source.inspect}" do
162
168
  @text = SamplePrefix+source
163
- pending if expected == :pending
169
+ #pending if expected == [:pending]
170
+ exception = nil
164
171
  lambda do
165
- @vocabulary = ActiveFacts::Input::CQL.readstring(@text)
172
+ begin
173
+ @vocabulary = ActiveFacts::Input::CQL.readstring(@text)
174
+ rescue => exception
175
+ if debug :exception
176
+ puts "#{exception.message}"
177
+ puts "\t#{exception.backtrace*"\n\t"}"
178
+ end
179
+ raise
180
+ end
166
181
  end.should_not raise_error
167
182
  result = instance_data(@vocabulary)
168
183
 
@@ -176,9 +191,18 @@ describe "Sample data" do
176
191
  it "should de-duplicate #{source.inspect}" do
177
192
  # Make sure you don't get anything duplicated
178
193
  @text = SamplePrefix+source+source
179
- pending if expected == :pending
194
+ #pending if expected == [:pending]
195
+ exception = nil
180
196
  lambda do
181
- @vocabulary = ActiveFacts::Input::CQL.readstring(@text)
197
+ begin
198
+ @vocabulary = ActiveFacts::Input::CQL.readstring(@text)
199
+ rescue => exception
200
+ if debug :exception
201
+ puts "#{exception.message}"
202
+ puts "\t#{exception.backtrace*"\n\t"}"
203
+ end
204
+ raise
205
+ end
182
206
  end.should_not raise_error
183
207
  result = instance_data(@vocabulary)
184
208
  result[0].should == expected[0]
@@ -48,8 +48,7 @@ describe "CQL Loader with SQL output" do
48
48
  sql_text = sql(vocabulary)
49
49
  File.open(actual_file, "w") { |f| f.write sql_text }
50
50
 
51
- next unless File.exists? expected_file
52
- # ("expected output file #{expected_file} not found")
51
+ pending("expected output file #{expected_file} not found") unless File.exists? expected_file
53
52
 
54
53
  expected_text = File.open(expected_file) {|f| f.read }
55
54
  broken = cql_mysql_failures[File.basename(actual_file, ".cql")]
@@ -18,7 +18,6 @@ describe "Column lists from absorption compared with Ruby's" do
18
18
  norma_ruby_failures = {
19
19
  "UnaryIdentification" => "No PI for VisitStatus",
20
20
  "BPMN" => "Has duplicate column names",
21
- "Diplomacy" => "Has duplicate column names",
22
21
  }
23
22
 
24
23
  # Generate and return the Ruby for the given vocabulary
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activefacts
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 8
10
- version: 0.8.8
9
+ - 9
10
+ version: 0.8.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Clifford Heath
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-09 00:00:00 +10:00
18
+ date: 2010-08-27 00:00:00 +10:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency