fact_checker 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'spec_helper'
4
-
5
- class ClassWithNoFacts
6
- include FactChecker
7
- end
8
-
9
- class ClassWithFacts
10
- include FactChecker
11
-
12
- def_fact :bare_fact
13
- def_fact :true_fact_with_no_dependencies, :if => lambda { true }
14
- def_fact :true_fact_with_true_dependencies => :bare_fact, :if => lambda { true }
15
- def_fact :true_fact_with_false_dependencies => :false_fact_with_no_dependencies, :if => lambda { true }
16
- def_fact :false_fact_with_no_dependencies, :if => lambda { false }
17
- def_fact :false_fact_with_true_dependencies => :bare_fact , :if => lambda { false }
18
- def_fact :false_fact_with_false_dependencies => :false_fact_with_no_dependencies , :if => lambda { false }
19
-
20
- def_fact :_private_fact
21
- end
22
-
23
- class ChildOfClassWithFacts < ClassWithFacts
24
- end
25
-
26
- # :another_fact should not creep back to parent classes
27
- class GrandChildOfClassWithFacts < ChildOfClassWithFacts
28
- def_fact :another_fact
29
- end
@@ -1,17 +0,0 @@
1
- # encoding: utf-8
2
-
3
- shared_examples 'an accomplished fact' do |true_or_false|
4
- specify '#fact_accomplished?' do
5
- target.fact_accomplished?(example.metadata[:fact]).should be true_or_false
6
- end
7
-
8
- specify '#(:fact)? predicate' do
9
- target.send("#{example.metadata[:fact]}?").should be true_or_false
10
- end
11
- end
12
-
13
- shared_examples 'a possible fact' do |true_or_false|
14
- specify '#fact_possible?' do
15
- target.fact_possible?(example.metadata[:fact]).should be true_or_false
16
- end
17
- end