rubylog 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/Gemfile.lock +10 -0
- data/README.rdoc +1 -1
- data/RELEASE_NOTES.rdoc +7 -4
- data/VERSION +1 -1
- data/{examples → benchmark}/benchmark.rb +1 -0
- data/{examples → benchmark}/benchmark/compiled_not_indexed.rb +0 -0
- data/{examples → benchmark}/benchmark/compiled_sequence_indexed.rb +0 -0
- data/{examples → benchmark}/benchmark/indexed_procedure.rb +0 -0
- data/{examples → benchmark}/benchmark/prolog.rb +0 -0
- data/benchmark/benchmark/pure.rb +28 -0
- data/bin/rubylog +14 -0
- data/examples/a_plus_b.rb +2 -2
- data/examples/dcg.rb +22 -26
- data/examples/dcg2.rb +25 -30
- data/examples/divisors.rb +1 -3
- data/examples/factorial.rb +8 -15
- data/examples/file_search.rb +14 -13
- data/examples/hanoi.rb +1 -3
- data/examples/hu/csaladfa.rb +0 -4
- data/examples/n_queens.rb +17 -22
- data/examples/palindrome_detection.rb +1 -2
- data/examples/parsing.rb +19 -23
- data/examples/permutation.rb +1 -3
- data/examples/primality_by_division.rb +2 -2
- data/examples/sieve_of_eratosthenes.rb +2 -2
- data/examples/string_interpolation.rb +0 -3
- data/examples/tracing.rb +0 -4
- data/lib/rubylog/builtins/assumption.rb +2 -1
- data/lib/rubylog/builtins/file_system.rb +1 -1
- data/lib/rubylog/default_context.rb +3 -5
- data/lib/rubylog/mixins/kernel.rb +9 -1
- data/lib/rubylog/rubylog_files.rb +7 -0
- data/rubylog.gemspec +17 -22
- data/spec/inriasuite_spec.rb +851 -847
- data/spec/integration/dsl_spec.rb +32 -29
- data/spec/rspec/rubylog_spec.rb +46 -52
- data/spec/rubylog/assertable_spec.rb +92 -90
- data/spec/rubylog/builtins/arithmetics_spec.rb +92 -90
- data/spec/rubylog/builtins/assumption_spec.rb +59 -57
- data/spec/rubylog/builtins/ensure_spec.rb +6 -4
- data/spec/rubylog/builtins/file_system_spec.rb +41 -39
- data/spec/rubylog/builtins/logic_spec.rb +308 -306
- data/spec/rubylog/builtins/reflection_spec.rb +31 -29
- data/spec/rubylog/builtins/term_spec.rb +62 -60
- data/spec/rubylog/context_modules/demonstration_spec.rb +108 -106
- data/spec/rubylog/context_modules/predicates_spec.rb +29 -27
- data/spec/rubylog/context_modules/thats_spec.rb +77 -75
- data/spec/rubylog/dsl/array_splat_spec.rb +11 -9
- data/spec/rubylog/dsl/indicators_spec.rb +23 -21
- data/spec/rubylog/dsl/primitives_spec.rb +30 -28
- data/spec/rubylog/errors_spec.rb +13 -11
- data/spec/rubylog/interfaces/term_spec.rb +78 -76
- data/spec/rubylog/mixins/array_spec.rb +60 -58
- data/spec/rubylog/mixins/composite_term_spec.rb +55 -53
- data/spec/rubylog/mixins/proc_spec.rb +48 -46
- data/spec/rubylog/mixins/string_spec.rb +45 -43
- data/spec/rubylog/mixins/symbol_spec.rb +7 -5
- data/spec/rubylog/procedure_spec.rb +8 -6
- data/spec/rubylog/rule_spec.rb +10 -8
- data/spec/rubylog/structure_spec.rb +73 -71
- data/spec/rubylog/term_spec.rb +5 -3
- data/spec/rubylog/tracing_spec.rb +35 -33
- data/spec/rubylog/variable_spec.rb +249 -247
- data/spec/spec_helper.rb +4 -0
- metadata +54 -43
- data/examples/benchmark/pure.rb +0 -26
- data/examples/checkmate.rb +0 -88
- data/examples/combination.rb +0 -17
- data/examples/directory_structure_logic.rb +0 -17
- data/examples/dirlist.rb +0 -4
- data/examples/enumerators.rb +0 -30
- data/examples/hello.rb +0 -17
- data/examples/mice.rb +0 -92
- data/examples/mice2.rb +0 -37
- data/examples/object_oriented.rb +0 -14
- data/examples/prefix.rb +0 -13
- data/examples/primitives.rb +0 -26
- data/examples/sudoku.rb +0 -17
- data/spec/integration/theory_as_module_spec.rb +0 -20
- data/spec/integration/theory_as_module_with_include_spec.rb +0 -14
@@ -1,38 +1,41 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
describe "prefix functors" do
|
6
|
-
before do
|
7
|
-
predicate_for singleton_class, ".we_have()"
|
8
|
-
we_have! :weapons
|
9
|
-
we_have! :sunglasses
|
10
|
-
we_have! :rustling_leather_coats
|
11
|
-
end
|
3
|
+
module RubylogSpec
|
12
4
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
describe "Rubylog dsl", :rubylog=>true do
|
6
|
+
|
7
|
+
describe "prefix functors" do
|
8
|
+
before do
|
9
|
+
predicate_for singleton_class, ".we_have()"
|
10
|
+
we_have! :weapons
|
11
|
+
we_have! :sunglasses
|
12
|
+
we_have! :rustling_leather_coats
|
13
|
+
end
|
14
|
+
|
15
|
+
it "works" do
|
16
|
+
check we_have :sunglasses
|
17
|
+
end
|
18
|
+
|
19
|
+
it "works with qmarks" do
|
20
|
+
check { we_have? :rustling_leather_coats }
|
21
|
+
end
|
19
22
|
end
|
20
|
-
end
|
21
23
|
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
describe "built-in prefix functors" do
|
26
|
+
check all X.is(4).and(Y.is(X)), Y.is(4)
|
27
|
+
check any X.is(4)
|
28
|
+
check one(X.in([1,2,3])) { X % 2 == 0 }
|
29
|
+
check none X.in([1,2,3]), X.is(5)
|
30
|
+
check { all?(X.is(4)) { X < 5 } }
|
31
|
+
end
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
describe "variables" do
|
34
|
+
check A.is(ANY).and{ A == Rubylog::Variable.new(:ANY) }
|
35
|
+
check A.is(4) .and{ A == 4 }
|
36
|
+
check B.is(A) .and{ A == Rubylog::Variable.new(:A) and B == Rubylog::Variable.new(:A) }
|
37
|
+
check B.is(ANY).and{ A == Rubylog::Variable.new(:A) }
|
38
|
+
end
|
37
39
|
|
40
|
+
end
|
38
41
|
end
|
data/spec/rspec/rubylog_spec.rb
CHANGED
@@ -1,75 +1,69 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
3
|
+
module RubylogSpec
|
4
|
+
describe "Rubylog", :rubylog => true do
|
4
5
|
|
5
|
-
|
6
|
+
predicate_for Integer, ".even"
|
6
7
|
|
7
|
-
|
8
|
+
N.even.if { N%2 == 0 }
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
it "checks for true statements" do
|
11
|
+
check :true
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
it "raises an exception for false statements" do
|
15
|
+
proc{check :fail}.should raise_exception(Rubylog::CheckFailed)
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
self.default_subject = Integer
|
18
|
+
proc{check 4.is 5}.should raise_exception(Rubylog::CheckFailed)
|
19
|
+
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
it "can use predicates" do
|
22
|
+
check((A.in [1,2]).and(B.in([2,3])).and(A.is 1).and(B.is 3))
|
23
|
+
end
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
it "can assert predicates" do
|
26
|
+
predicate_for Integer, ".divides()"
|
27
|
+
(A.divides B).if {B%A == 0}
|
28
|
+
check(4.divides 12)
|
29
|
+
check((4.divides 30).false)
|
30
|
+
end
|
27
31
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
check((4.divides 30).false)
|
33
|
-
end
|
32
|
+
it "can use predicates defined outside" do
|
33
|
+
check 1.even.false
|
34
|
+
check 2.even
|
35
|
+
end
|
34
36
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
describe "nested check" do
|
38
|
+
it "works" do
|
39
|
+
check 9.even.false
|
40
|
+
end
|
41
|
+
end
|
39
42
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
+
# inline check
|
44
|
+
check 0.even
|
45
|
+
|
46
|
+
describe "nested inline check" do
|
47
|
+
check 3.even.false
|
48
|
+
check 4.even
|
43
49
|
end
|
44
|
-
end
|
45
50
|
|
46
|
-
# inline check
|
47
|
-
check 0.even
|
48
|
-
|
49
|
-
describe "nested inline check" do
|
50
|
-
check 3.even.false
|
51
|
-
check 4.even
|
52
51
|
end
|
53
52
|
|
54
|
-
|
53
|
+
describe "Rubylog" do
|
54
|
+
describe "when not included" do
|
55
55
|
|
56
|
-
|
57
|
-
|
56
|
+
it "does not add methods" do
|
57
|
+
proc{check :true}.should raise_exception NameError
|
58
|
+
proc{trace}.should raise_exception NameError
|
59
|
+
end
|
58
60
|
|
59
|
-
it "does not add methods" do
|
60
|
-
proc{check :true}.should raise_exception NameError
|
61
|
-
proc{trace}.should raise_exception NameError
|
62
61
|
end
|
63
|
-
|
64
|
-
it "does not add constants" do
|
65
|
-
proc{A}.should raise_exception NameError
|
66
|
-
end
|
67
|
-
|
68
62
|
end
|
69
|
-
end
|
70
63
|
|
64
|
+
end
|
71
65
|
|
72
66
|
|
73
|
-
#require "rspec/core/formatters/progress_formatter"
|
74
|
-
#require "rspec/core/formatters/documentation_formatter"
|
75
|
-
#EG.run RSpec::Core::Reporter.new RSpec::Core::Formatters::DocumentationFormatter.new(STDOUT)
|
67
|
+
#require "rspec/core/formatters/progress_formatter"
|
68
|
+
#require "rspec/core/formatters/documentation_formatter"
|
69
|
+
#EG.run RSpec::Core::Reporter.new RSpec::Core::Formatters::DocumentationFormatter.new(STDOUT)
|
@@ -1,111 +1,113 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
describe "with prolog body" do
|
10
|
-
it "cannot be asserted in a builtin's desc" do
|
11
|
-
lambda {
|
12
|
-
:john.likes(:beer).and! :jane.likes(:milk)
|
13
|
-
}.should raise_error
|
3
|
+
module RubylogSpec
|
4
|
+
describe "rules", :rubylog=>true do
|
5
|
+
before do
|
6
|
+
predicate_for Symbol, ".likes(Drink) .is_happy .has()"
|
7
|
+
predicate_for_context ".we_have()"
|
14
8
|
end
|
15
9
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
10
|
+
describe "with prolog body" do
|
11
|
+
it "cannot be asserted in a builtin's desc" do
|
12
|
+
lambda {
|
13
|
+
:john.likes(:beer).and! :jane.likes(:milk)
|
14
|
+
}.should raise_error
|
15
|
+
end
|
22
16
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
17
|
+
it "can be asserted with if" do
|
18
|
+
:john.is_happy.if we_have(:beer)
|
19
|
+
:john.is_happy?.should be_false
|
20
|
+
we_have!(:beer)
|
21
|
+
:john.is_happy?.should be_true
|
22
|
+
end
|
29
23
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
:john.likes! :beer
|
37
|
-
:john.is_happy?.should be_true
|
38
|
-
end
|
24
|
+
it "can be asserted with unless" do
|
25
|
+
:john.is_happy.unless we_have(:problem)
|
26
|
+
:john.is_happy?.should be_true
|
27
|
+
we_have!(:problem)
|
28
|
+
:john.is_happy?.should be_false
|
29
|
+
end
|
39
30
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
31
|
+
it "can do simple general implications" do
|
32
|
+
X.is_happy.if X.likes(Y).and X.has(Y)
|
33
|
+
:john.likes! :milk
|
34
|
+
:john.is_happy?.should be_false
|
35
|
+
:john.has! :beer
|
36
|
+
:john.is_happy?.should be_false
|
37
|
+
:john.likes! :beer
|
38
|
+
:john.is_happy?.should be_true
|
39
|
+
end
|
44
40
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
41
|
+
it "can yield implied solutions" do
|
42
|
+
predicate_for Symbol, ".brother() .father() .uncle()"
|
43
|
+
X.brother(Y).if X.father(Z).and Y.father(Z).and {X != Y}
|
44
|
+
X.uncle(Y).if X.father(Z).and Z.brother(Y)
|
49
45
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
(:john.uncle X).map{X}.should == [:jim]
|
55
|
-
end
|
56
|
-
end
|
46
|
+
:john.father! :dad
|
47
|
+
:jack.father! :dad
|
48
|
+
:dad.father! :grandpa
|
49
|
+
:jim.father! :grandpa
|
57
50
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
51
|
+
(:john.brother X).map{X}.should == [:jack]
|
52
|
+
(:john.father X).map{X}.should == [:dad]
|
53
|
+
(X.father :dad).map{X}.should == [:john, :jack]
|
54
|
+
(ANY.father X).map{X}.should == [:dad, :dad, :grandpa, :grandpa]
|
55
|
+
(:john.uncle X).map{X}.should == [:jim]
|
56
|
+
end
|
62
57
|
end
|
63
58
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
59
|
+
describe "with ruby body" do
|
60
|
+
it "can be asserted (true)" do
|
61
|
+
:john.is_happy.if proc{ true }
|
62
|
+
:john.is_happy?.should be_true
|
63
|
+
end
|
68
64
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
65
|
+
it "can be asserted (false)" do
|
66
|
+
:john.is_happy.if proc{ false }
|
67
|
+
:john.is_happy?.should be_false
|
68
|
+
end
|
73
69
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
70
|
+
it "can be asserted implicitly (true)" do
|
71
|
+
:john.is_happy.if { true }
|
72
|
+
:john.is_happy?.should be_true
|
73
|
+
end
|
78
74
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
75
|
+
it "can be asserted implicitly (false)" do
|
76
|
+
:john.is_happy.if { false }
|
77
|
+
:john.is_happy?.should be_false
|
78
|
+
end
|
79
|
+
|
80
|
+
it "run the body during every query" do
|
81
|
+
count = 0
|
82
|
+
:john.is_happy.if proc{ count += 1 }
|
83
|
+
count.should == 0
|
84
|
+
:john.is_happy?
|
85
|
+
count.should == 1
|
86
|
+
:john.is_happy?
|
87
|
+
count.should == 2
|
88
|
+
end
|
88
89
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
90
|
+
it "can take arguments" do
|
91
|
+
predicate_for Integer, ".divides()"
|
92
|
+
(A.divides B).if proc{B % A == 0}
|
93
|
+
(4.divides? 16).should be_true
|
94
|
+
(4.divides? 17).should be_false
|
95
|
+
(4.divides? 18).should be_false
|
96
|
+
(3.divides? 3).should be_true
|
97
|
+
(3.divides? 4).should be_false
|
98
|
+
(3.divides? 5).should be_false
|
99
|
+
(3.divides? 6).should be_true
|
100
|
+
end
|
99
101
|
end
|
100
|
-
end
|
101
102
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
103
|
+
describe "#if!" do
|
104
|
+
it "can be used to cut off branches" do
|
105
|
+
predicate_for Integer, ".divides()"
|
106
|
+
1.divides(X).if! :true
|
107
|
+
(A.divides B).if proc{B % A == 0}
|
108
|
+
1.divides(4).map{}.should == [nil]
|
109
|
+
2.divides(4).map{}.should == [nil]
|
110
|
+
end
|
109
111
|
end
|
110
112
|
end
|
111
113
|
end
|
@@ -1,94 +1,96 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
3
|
+
module RubylogSpec
|
4
|
+
describe "Arithmetics builtins", :rubylog=>true do
|
5
|
+
check 5.sum_of 2, 3
|
6
|
+
|
7
|
+
check((5.sum_of 2, 6).false)
|
8
|
+
|
9
|
+
check { 5.sum_of(3, A).map{A}.eql? [2] }
|
10
|
+
check { 5.sum_of(A, 2).map{A}.eql? [3] }
|
11
|
+
check { A.sum_of(3, 4).map{A}.eql? [7] }
|
12
|
+
|
13
|
+
check A.is(5).and B.is(3).and C.is(2).and A.sum_of(C, B)
|
14
|
+
|
15
|
+
it "works with functions" do
|
16
|
+
check A.is(5).and 5.sum_of(proc{2}, proc{A-2})
|
17
|
+
check A.is(5).and 5.sum_of(proc{3}, proc{A-2}).false
|
18
|
+
end
|
19
|
+
|
20
|
+
it "checks types" do
|
21
|
+
check 4.sum_of(2,2.0).false
|
22
|
+
check 4.0.sum_of(2.0,2.0)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "can add strings" do
|
26
|
+
A.sum_of(B,C).predicate.add_functor_to String
|
27
|
+
check "hello".sum_of("he", "llo")
|
28
|
+
end
|
29
|
+
|
30
|
+
it "can add arrays" do
|
31
|
+
A.sum_of(B,C).predicate.add_functor_to Array
|
32
|
+
check [1,2,3].sum_of([1,2], [3])
|
33
|
+
end
|
34
|
+
|
35
|
+
it "can subtract arrays" do
|
36
|
+
A.sum_of(B,C).predicate.add_functor_to Array
|
37
|
+
[1,2,3].sum_of(X, [3]).map{X}.should be_eql [[1,2]]
|
38
|
+
end
|
39
|
+
|
40
|
+
it "can multiply integers" do
|
41
|
+
A.product_of(3,2).map{A}.should be_eql [6]
|
42
|
+
end
|
43
|
+
|
44
|
+
it "can divide integers" do
|
45
|
+
6.product_of(A,2).map{A}.should be_eql [3]
|
46
|
+
end
|
47
|
+
|
48
|
+
it "can divide integers" do
|
49
|
+
6.product_of(3,A).map{A}.should be_eql [2]
|
50
|
+
end
|
51
|
+
|
52
|
+
it "can divide floats" do
|
53
|
+
6.0.product_of(A,2.0).map{A}.should be_eql [3.0]
|
54
|
+
end
|
55
|
+
|
56
|
+
it "can divide floats" do
|
57
|
+
6.0.product_of(3.0,A).map{A}.should be_eql [2.0]
|
58
|
+
end
|
59
|
+
|
60
|
+
it "checks non-divisibility of integers" do
|
61
|
+
6.product_of(5,A).map{A}.should be_eql []
|
62
|
+
end
|
63
|
+
|
64
|
+
it "checks non-divisibility of integers" do
|
65
|
+
6.product_of(A,4).map{A}.should be_eql []
|
66
|
+
end
|
67
|
+
|
68
|
+
it "casts types" do
|
69
|
+
6.0.product_of(A,2).map{A}.should be_eql [3.0]
|
70
|
+
end
|
71
|
+
|
72
|
+
it "casts types" do
|
73
|
+
6.0.product_of(3,A).map{A}.should be_eql [2.0]
|
74
|
+
end
|
75
|
+
|
76
|
+
it "casts types" do
|
77
|
+
A.product_of(3,2.0).map{A}.should be_eql [6.0]
|
78
|
+
end
|
79
|
+
|
80
|
+
it "checks instatiation" do
|
81
|
+
expect { 8.product_of(B,C).map{[B,C]} }.to raise_error Rubylog::InstantiationError
|
82
|
+
end
|
83
|
+
|
84
|
+
it "checks instatiation" do
|
85
|
+
expect { 8.sum_of(B,C).map{[B,C]} }.to raise_error Rubylog::InstantiationError
|
86
|
+
end
|
87
|
+
|
88
|
+
it "checks instatiation" do
|
89
|
+
expect { A.sum_of(B,2).map{[B,C]} }.to raise_error Rubylog::InstantiationError
|
90
|
+
end
|
91
|
+
|
92
|
+
it "checks instatiation" do
|
93
|
+
expect { A.product_of(B,2).map{[B,C]} }.to raise_error Rubylog::InstantiationError
|
94
|
+
end
|
93
95
|
end
|
94
96
|
end
|