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.
- checksums.yaml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/README.md +102 -17
- data/fact_checker.gemspec +5 -4
- data/lib/fact_checker/mixin.rb +32 -0
- data/lib/fact_checker/result.rb +18 -0
- data/lib/fact_checker/version.rb +1 -1
- data/lib/fact_checker.rb +2 -2
- data/spec/mixin_spec.rb +238 -0
- data/spec/result_spec.rb +29 -0
- data/spec/spec_helper.rb +3 -3
- data/spec/version_spec.rb +9 -0
- metadata +59 -39
- data/.rvmrc +0 -1
- data/examples/README.md +0 -72
- data/examples/basic.rb +0 -60
- data/lib/fact_checker/base.rb +0 -79
- data/lib/fact_checker/boot.rb +0 -31
- data/spec/fact_checker/base_spec.rb +0 -272
- data/spec/fact_checker/version_spec.rb +0 -7
- data/spec/fact_checker_inheritance_spec.rb +0 -63
- data/spec/fact_checker_spec.rb +0 -87
- data/spec/support/classes_with_facts.rb +0 -29
- data/spec/support/shared_facts_behaviour.rb +0 -17
@@ -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
|