fact_checker 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use 1.9.2@fact_checker 2>/dev/null
1
+ rvm use 1.9.3 2>/dev/null
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Fact Checker
2
+
3
+ Simple ruby gem to check hierarchically dependent "facts" about objects.
4
+
5
+ ## Installation
6
+
7
+ gem install fact_checker
8
+
9
+ ## Synopsys
10
+
11
+ ``` ruby
12
+ class Person
13
+ include FactChecker
14
+
15
+ def_fact :good_job, if: ->(p) { p.job.good? }
16
+ def_fact :good_family, if: ->(p) { p.family.good? }
17
+ def_fact :is_healthy, if: ->(p) { p.health.good? }
18
+ def_fact :is_happy => [:is_healthy, :good_family, :good_job], if: ->(p) { ! p.too_clever? }
19
+
20
+ ...
21
+ end
22
+
23
+ p = Person.new(:job => good_job, :family => good_family, :health => :good, :intellect => :too_clever)
24
+ p.good_job? # => true
25
+ p.good_family? # => true
26
+ p.is_healthy? # => true
27
+ p.fact_possible?(:is_happy) # => true (dependency satisfied)
28
+ p.is_happy? # => false
29
+
30
+ p.possible_facts - p.accomplished_facts # => [:happy]
31
+ ```
data/fact_checker.gemspec CHANGED
@@ -23,7 +23,8 @@ Gem::Specification.new do |s|
23
23
  s.required_ruby_version = ">= 1.8.7"
24
24
  s.required_rubygems_version = ">= 1.3.5"
25
25
 
26
- s.add_development_dependency 'rspec', '~> 2.6'
26
+ s.add_development_dependency 'rspec', '~> 2.8.0'
27
27
  s.add_development_dependency 'rake'
28
28
  s.add_development_dependency 'bundler'
29
+ s.add_development_dependency 'simplecov', '~> 0.6.1'
29
30
  end
@@ -20,6 +20,7 @@ module FactChecker
20
20
  def accomplished_facts(context)
21
21
  facts.select{ |fact| fact_accomplished?(context, fact) }
22
22
  end
23
+
23
24
  def possible_facts(context)
24
25
  facts.select{ |fact| fact_possible?(context, fact) }
25
26
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module FactChecker
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
@@ -3,178 +3,270 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  describe FactChecker::Base do
6
- describe "constructor" do
7
- it "should accept facts, dependencies and requirements as arguments" do
8
- fc = FactChecker::Base.new([:a, :b], {:a => :b}, {:b => :nil?})
9
- fc.facts.should == [:a, :b]
10
- fc.dependencies.should == {:a => :b}
11
- fc.requirements.should == {:b => :nil?}
12
- end
13
- it "should use empty hash as a default for requirements" do
14
- fc = FactChecker::Base.new([:a, :b], {:a => :b})
15
- fc.requirements.should == {}
16
- end
17
- it "should use empty hash as a default for dependencies" do
18
- fc = FactChecker::Base.new([:a, :b])
19
- fc.dependencies.should == {}
20
- end
21
- it "should use empty array as a default for facts" do
22
- fc = FactChecker::Base.new()
23
- fc.facts.should == []
24
- end
25
- end
26
6
 
27
- describe "#facts" do
28
- it "should return all facts" do
29
- fc = FactChecker::Base.new([:f1, :f2])
30
- fc.facts.should == [:f1, :f2]
7
+ describe "#initialize" do
8
+ context "called with all arguments (fact_list, dependencies_hash, requirements_hash), its " do
9
+ subject { FactChecker::Base.new([:f1, :f2], {:f1 => :f2}, {:f1 => :nil?}) }
10
+ specify("facts == fact_list") { subject.facts.should == [:f1, :f2] }
11
+ specify("dependencies == dependencies_hash") { subject.dependencies.should == {:f1 => :f2} }
12
+ specify("requirements == requirements_hash") { subject.requirements.should == {:f1 => :nil?} }
31
13
  end
32
- end
33
14
 
34
- describe "#accomplished_facts" do
35
- it "should return accomplished facts" do
36
- fc = FactChecker::Base.new([:f1, :f2], nil, {:f2 => lambda{ false }})
37
- fc.accomplished_facts("context").should == [:f1]
15
+ context "called" do
16
+ specify("without fact_list, its facts == [] by default") { subject.facts.should == [] }
17
+ specify("without dependencies_hash, its dependencies == {} by default") { subject.dependencies.should == {} }
18
+ specify("without requirements_hash, its requirements == {} by default") { subject.requirements.should == {} }
38
19
  end
39
20
  end
40
21
 
41
- describe "#possible_facts" do
42
- it "should return possible facts" do
43
- fc = FactChecker::Base.new([:f1, :f2], {:f1 => :f2}, {:f2 => lambda{ false }})
44
- fc.possible_facts("context").should == [:f2]
22
+ describe "#requirement_satisfied_for?(context, fact)" do
23
+ context "when no requirement defined for the fact" do
24
+ subject { FactChecker::Base.new([:f1]) }
25
+ it "returns true for any object" do
26
+ subject.requirement_satisfied_for?(1, :f1).should be_true
27
+ subject.requirement_satisfied_for?(nil, :f1).should be_true
28
+ end
45
29
  end
46
- end
47
30
 
48
- describe "#requirement_satisfied_for?" do
49
- it "should return true if no requerment defined for the step" do
50
- fc = FactChecker::Base.new([:f1])
51
- fc.requirement_satisfied_for?(1, :f1).should be_true
31
+ context "when requirement for the fact was defined as symbol" do
32
+ subject { FactChecker::Base.new([:f1], nil, {:f1 => :nil?}) }
33
+ it "returns false if fact is unknown" do
34
+ subject.requirement_satisfied_for?(1, :f2).should be_false
35
+ end
36
+ it "returns false if context.symbol() == false" do
37
+ subject.requirement_satisfied_for?(1, :f1).should be_false
38
+ end
39
+ it "returns true if context.symbol() == true" do
40
+ subject.requirement_satisfied_for?(nil, :f1).should be_true
41
+ end
52
42
  end
53
- it "should return false if fact is unknown" do
54
- fc = FactChecker::Base.new([:f1], nil, {:f1 => :nil?})
55
- fc.requirement_satisfied_for?(1, :f2).should be_false
56
- end
57
- it "should return false if requirement is :symbol and context.symbol() == false" do
58
- fc = FactChecker::Base.new([:f1], nil, {:f1 => :nil?})
59
- fc.requirement_satisfied_for?(1, :f1).should be_false
60
- end
61
- it "should return true if requirement is :symbol and context.symbol() == true" do
62
- fc = FactChecker::Base.new([:f1], nil, {:f1 => :nil?})
63
- fc.requirement_satisfied_for?(nil, :f1).should be_true
64
- end
65
- it "should return false if requirement is Proc and proc(context) == false" do
66
- fc = FactChecker::Base.new([:f1], nil, {:f1 => lambda{|t| t.nil?}})
67
- fc.requirement_satisfied_for?(1, :f1).should be_false
68
- end
69
- it "should return true if requirement is Proc and proc(context) == true" do
70
- fc = FactChecker::Base.new([:f1], nil, {:f1 => lambda{|t| t.nil?}})
71
- fc.requirement_satisfied_for?(nil, :f1).should be_true
72
- end
73
- it "should return false if requirement is Proc with arity < 1 and proc() == false" do
74
- fc = FactChecker::Base.new([:f1], nil, {:f1 => lambda{false}})
75
- fc.requirement_satisfied_for?(nil, :f1).should be_false
43
+
44
+ context "when requirement was defined as Proc with arity == 1" do
45
+ subject { FactChecker::Base.new([:f1], nil, {:f1 => lambda{|t| t.nil?}}) }
46
+ it "returns false if proc(context) == false" do
47
+ subject.requirement_satisfied_for?(1, :f1).should be_false
48
+ end
49
+ it "returns true if proc(context) == true" do
50
+ subject.requirement_satisfied_for?(nil, :f1).should be_true
51
+ end
76
52
  end
77
- it "should return true if requirement is Proc with arity < 1 and proc() == true" do
78
- fc = FactChecker::Base.new([:f1], nil, {:f1 => lambda{true}})
79
- fc.requirement_satisfied_for?(nil, :f1).should be_true
53
+
54
+ context "when requirement was defined as Proc with arity == 0" do
55
+ it "returns false if proc() == false" do
56
+ subject = FactChecker::Base.new([:f1], nil, {:f1 => lambda{false}})
57
+ subject.requirement_satisfied_for?(nil, :f1).should be_false
58
+ end
59
+ it "returns true if proc() == true" do
60
+ subject = FactChecker::Base.new([:f1], nil, {:f1 => lambda{true}})
61
+ subject.requirement_satisfied_for?(nil, :f1).should be_true
62
+ end
80
63
  end
81
- it "should raise RuntimeError if requirement has wrong type" do
82
- fc = FactChecker::Base.new([:f1], nil, {:f1 => "wrong"})
83
- lambda{fc.requirement_satisfied_for?(nil, :f1)}.should raise_error(RuntimeError)
64
+
65
+ context "when requirement was defined as something else" do
66
+ subject { FactChecker::Base.new([:f1], nil, {:f1 => "wrong"}) }
67
+ it "raises RuntimeError" do
68
+ lambda{ subject.requirement_satisfied_for?(nil, :f1) }.should raise_error(RuntimeError)
69
+ end
84
70
  end
85
71
  end
86
72
 
87
73
  describe "#fact_accomplished?" do
88
- it "should return false if fact is unknown" do
89
- fc = FactChecker::Base.new([:f2], nil, {:f1 => :nil?})
90
- fc.fact_accomplished?(nil, :f1).should be_false
91
- end
92
- it "should return true if requirement satisfied and fact has no dependencies" do
93
- fc = FactChecker::Base.new([:f1], nil, {:f1 => lambda{|o| o.size > 2}})
94
- fc.fact_accomplished?("name", :f1).should be_true
95
- end
96
- it "should return false if requirement not satisfied (fact has no dependencies)" do
97
- fc = FactChecker::Base.new([:f1], nil, {:f1 => :nil?})
98
- fc.fact_accomplished?("something", :f1).should be_false
99
- end
100
- it "should return false if fact has unsatisfied dependencies" do
101
- fc = FactChecker::Base.new([:f1, :f2], {:f1 => :f2}, {:f2 => :nil?})
102
- fc.fact_accomplished?("something", :f1).should be_false
103
- end
104
- it "should return false if fact has both satisfied and unsatisfied dependencies" do
105
- fc = FactChecker::Base.new([:f1, :f2, :f3, :f4], {:f1 => [:f2, :f3], :f3 => :f4}, {:f2 => :size, :f3 => :size, :f4 => :nil?})
106
- fc.fact_accomplished?("something", :f1).should be_false
107
- end
108
- it "should return true if all dependencies are satisfied and fact has no requirements" do
109
- fc = FactChecker::Base.new([:f1, :f2, :f3, :f4], {:f1 => [:f2, :f3], :f3 => :f4}, {:f2 => :size, :f3 => :size, :f4 => :size})
110
- fc.fact_accomplished?("something", :f1).should be_true
74
+ context "when fact is unknown" do
75
+ subject { FactChecker::Base.new([:f2], nil, {:f1 => :nil?}) }
76
+ it("always returns false") { subject.fact_accomplished?(nil, :f1).should be_false }
111
77
  end
112
- it "should return false if requirements not satisfied (all dependencies are satisfied)" do
113
- fc = FactChecker::Base.new([:f1, :f2, :f3, :f4], {:f1 => [:f2, :f3], :f3 => :f4}, {:f1 => :nil?, :f2 => :size, :f3 => :size, :f4 => :size})
114
- fc.fact_accomplished?("something", :f1).should be_false
78
+
79
+ context "when fact is known and" do
80
+ context "has no dependencies" do
81
+ subject { FactChecker::Base.new([:f1], nil, {:f1 => lambda{|o| o.size > 3}}) }
82
+ it("returns true if requirement satisfied") do
83
+ subject.fact_accomplished?("String", :f1).should be_true
84
+ end
85
+ it "returns false if requirement not satisfied" do
86
+ subject.fact_accomplished?("Str", :f1).should be_false
87
+ end
88
+ end
89
+
90
+ context "has only unsatisfied dependencies" do
91
+ subject { FactChecker::Base.new([:f1, :f2], {:f1 => :f2}, {:f1 => lambda{true}, :f2 => :nil?}) }
92
+ it "returns false" do
93
+ subject.fact_accomplished?("something", :f1).should be_false
94
+ end
95
+ end
96
+
97
+ context "has both satisfied and unsatisfied dependencies" do
98
+ subject { FactChecker::Base.new([:f1, :f2, :f3, :f4], {:f1 => [:f2, :f3], :f3 => :f4}, {:f2 => :size, :f3 => :size, :f4 => :nil?}) }
99
+ it "returns false" do
100
+ subject.fact_accomplished?("something", :f1).should be_false
101
+ end
102
+ end
103
+
104
+ context "has only satisfied dependencies" do
105
+ subject {
106
+ FactChecker::Base.new(
107
+ [:f1, :f2, :f3, :f4],
108
+ {:f1 => [:f2, :f3], :f3 => :f4},
109
+ {:f1 => lambda{|o| o.size == 4}, :f2 => lambda{|o| o.size < 5}, :f3 => lambda{|o| o.size > 2} }
110
+ )
111
+ }
112
+
113
+ it "returns true if fact has no requirements" do
114
+ subject.fact_accomplished?("something", :f4).should be_true
115
+ end
116
+
117
+ it "returns false if requirements not satisfied" do
118
+ subject.fact_accomplished?("somet", :f1).should be_false
119
+ end
120
+
121
+ it "returns true if all requirements are satisfied" do
122
+ subject.fact_accomplished?("some", :f1).should be_true
123
+ end
124
+ end
115
125
  end
116
126
  end
117
127
 
118
128
  describe "#fact_possible?" do
119
- it "should return true if fact is unknown" do
120
- fc = FactChecker::Base.new([:f2], nil, {:f1 => :nil?})
121
- fc.fact_possible?(nil, :f1).should be_true
122
- end
123
- it "should return true if dependencies satisfied (even if requirement is not satisfied)" do
124
- fc = FactChecker::Base.new([:f1], nil, {:f1 => :nil?})
125
- fc.fact_possible?(1, :f1).should be_true
129
+ context "when fact is unknown" do
130
+ it "returns true" do
131
+ subject.fact_possible?(nil, :x).should be_true
132
+ end
126
133
  end
127
- it "should return false if dependencies unsatisfied (even if requirement is satisfied)" do
128
- fc = FactChecker::Base.new([:f1], {:f1 => :f2}, {:f2 => :nil?})
129
- fc.fact_possible?(1, :f1).should be_false
134
+
135
+ context "when fact is known" do
136
+ it "returns true if dependencies satisfied (even if requirement is not satisfied)" do
137
+ subject = FactChecker::Base.new([:f1, :f2], {:f1 => :f2}, {:f1 => :nil?, :f2 => :to_i})
138
+ subject.fact_possible?(1, :f1).should be_true
139
+ end
140
+
141
+ it "returns false if dependencies unsatisfied (even if requirement is satisfied)" do
142
+ subject = FactChecker::Base.new([:f1, :f2], {:f1 => :f2}, {:f1 => :to_i, :f2 => :nil?})
143
+ subject.fact_possible?(1, :f1).should be_false
144
+ end
130
145
  end
131
146
  end
132
147
 
133
148
  describe "#def_fact" do
134
- let(:fc) { FactChecker::Base.new }
149
+ context "called with (:fact_name)" do
150
+ it "adds :fact_name to facts" do
151
+ subject.def_fact(:f1)
152
+ subject.def_fact(:f2)
153
+ subject.facts.should == [:f1, :f2]
154
+ end
135
155
 
136
- it "should add argument to facts when called with (:fact) and return (:fact)" do
137
- fc.def_fact(:f1).should be :f1
138
- fc.def_fact(:f2).should be :f2
139
- fc.facts.should == [:f1, :f2]
156
+ it "returns :fact_name" do
157
+ subject.def_fact(:f1).should be :f1
158
+ end
140
159
  end
141
160
 
142
- it "should define fact correctly when called with (:fact, :if => :requirement)" do
143
- fc.def_fact(:f1)
144
- fc.def_fact(:f2, :if => :nil?)
145
- fc.facts.should == [:f1, :f2]
146
- fc.requirements[:f2].should == :nil?
161
+ context "called with (:fact_name, :if => :requirement)" do
162
+ it "adds :fact_name to facts" do
163
+ subject.def_fact(:f1)
164
+ subject.def_fact(:f2, :if => :nil?)
165
+ subject.facts.should == [:f1, :f2]
166
+ end
167
+
168
+ it "adds :requirement to requirements" do
169
+ subject.def_fact(:f2, :if => :nil?)
170
+ subject.requirements[:f2].should == :nil?
171
+ end
147
172
  end
148
173
 
149
- it "should define fact correctly when called with (:fact => :dependency)" do
150
- fc.def_fact(:f1)
151
- fc.def_fact(:f2 => :f1)
152
- fc.facts.should == [:f1, :f2]
153
- fc.dependencies[:f2].should == :f1
174
+ context "called with (:fact_name => :dependency)" do
175
+ it "adds :fact_name to facts" do
176
+ subject.def_fact(:f1)
177
+ subject.def_fact(:f2 => :f1)
178
+ subject.facts.should == [:f1, :f2]
179
+ end
180
+
181
+ it "adds :dependency to dependencies" do
182
+ subject.def_fact(:f2 => :f1)
183
+ subject.dependencies[:f2].should == :f1
184
+ end
154
185
  end
155
186
 
156
- it "should define fact correctly when called with (:fact => :dependency, :if => :requirement)" do
157
- fc.def_fact(:f1)
158
- fc.def_fact(:f2 => :f1, :if => :nil?)
159
- fc.facts.should == [:f1, :f2]
160
- fc.dependencies[:f2].should == :f1
161
- fc.requirements[:f2].should == :nil?
187
+ context "called with (:fact_name => :dependency, :if => :requirement)" do
188
+ subject do
189
+ FactChecker::Base.new.tap do |checker|
190
+ checker.def_fact(:f1)
191
+ checker.def_fact(:f2 => :f1, :if => :to_i)
192
+ end
193
+ end
194
+
195
+ it "adds :fact_name to facts" do
196
+ subject.facts.should == [:f1, :f2]
197
+ end
198
+
199
+ it "adds :requirement to requirements" do
200
+ subject.requirements[:f2].should == :to_i
201
+ end
202
+
203
+ it "adds :dependency to dependencies" do
204
+ subject.dependencies[:f2].should == :f1
205
+ end
162
206
  end
163
207
 
164
- it "should redefine fact if a fact with a given name already exists" do
165
- fc.def_fact(:f1 => :f2, :if => :nil?)
166
- fc.def_fact(:f1)
167
- fc.facts.should == [:f1]
168
- fc.requirements[:f1].should be_nil
169
- fc.dependencies[:f1].should be_nil
208
+ context "called again for the same fact_name" do
209
+ subject do
210
+ FactChecker::Base.new.tap do |checker|
211
+ checker.def_fact(:f1 => :f2, :if => :nil?)
212
+ checker.def_fact(:f1)
213
+ end
214
+ end
215
+
216
+ it "doesn't add 2nd fact_name to facts" do
217
+ subject.facts.should == [:f1]
218
+ end
219
+
220
+ it "overwrites fact_name's dependency" do
221
+ subject.dependencies[:f1].should be_nil
222
+ end
223
+
224
+ it "overwrites fact_name's requirement" do
225
+ subject.requirements[:f1].should be_nil
226
+ end
170
227
  end
171
228
 
172
- it "should raise ArgumentError exception when called with wrong arguments" do
173
- expect { fc.def_fact() }.to raise_error ArgumentError
174
- expect { fc.def_fact(:f1, {:if => :nil?}, true) }.to raise_error ArgumentError
175
- expect { fc.def_fact(:f1, :f2) }.to raise_error ArgumentError
176
- expect { fc.def_fact({:if => :nil?}, :f1) }.to raise_error ArgumentError
177
- expect { fc.def_fact(:f1 => :f2, :if => :nil?, :something_else => true) }.to raise_error ArgumentError
229
+ context "called with wrong arguments it RAISES ERROR, for example" do
230
+ specify "#def_fact() raises error" do
231
+ expect { subject.def_fact() }.to raise_error ArgumentError
232
+ end
233
+
234
+ specify "#def_fact(:fact_name, {:if => :requirement}, something_else) raises error" do
235
+ expect { subject.def_fact(:f1, {:if => :nil?}, 1) }.to raise_error ArgumentError
236
+ end
237
+
238
+ specify "#def_fact(:fact_name, some_scalar_value) raises error" do
239
+ expect { subject.def_fact(:f1, 1)}.to raise_error ArgumentError
240
+ end
241
+
242
+ specify "#def_fact({:if => :requirement}, something_else) raises error" do
243
+ expect { subject.def_fact({:if => :nil?}, :f1) }.to raise_error ArgumentError
244
+ end
245
+
246
+ specify "#def_fact(:fact_name => :dependency, :if => :requirement, :some_other_key => something_else) raises error" do
247
+ expect { subject.def_fact(:f1 => :f2, :if => :nil?, :something_else => true) }.to raise_error ArgumentError
248
+ end
249
+ end
250
+ end
251
+
252
+ context "has 3 *_facts methods, i.e." do
253
+ subject { FactChecker::Base.new([:f1, :f2, :f3], {:f1 => :f2}, {:f2 => :nil?, :f3 => lambda{false} }) }
254
+
255
+ describe "#accomplished_facts" do
256
+ it "returns accomplished facts - ones with both dependencies and requirements satisfied" do
257
+ subject.accomplished_facts(nil).should == [:f1, :f2]
258
+ end
259
+ end
260
+
261
+ describe "#possible_facts" do
262
+ it "returns possible facts - ones with dependencies but not requirements satisfied" do
263
+ subject.possible_facts("SomeString").should == [:f2, :f3]
264
+ end
265
+ end
266
+
267
+ describe "#facts" do
268
+ it("returns all defined facts") { subject.facts.should == [:f1, :f2, :f3] }
178
269
  end
179
270
  end
271
+
180
272
  end
data/spec/spec_helper.rb CHANGED
@@ -1,16 +1,19 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  $:.unshift File.expand_path('../lib', __FILE__)
4
+
5
+ require 'simplecov'
6
+ SimpleCov.start
7
+
4
8
  require 'fact_checker'
5
9
  Dir['./spec/support/**/*.rb'].each { |f| require f }
6
10
 
7
11
  RSpec.configure do |conf|
12
+ conf.formatter = :documentation
8
13
  conf.color_enabled = true
9
14
  conf.treat_symbols_as_metadata_keys_with_true_values = true
10
-
11
15
  conf.expect_with :rspec, :stdlib
12
16
  conf.mock_with :rspec
13
-
14
17
  conf.fail_fast = true
15
18
  conf.filter_run :focus => true
16
19
  conf.filter_run_excluding :broken => true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fact_checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,23 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-10-31 00:00:00.000000000 +04:00
14
- default_executable:
13
+ date: 2012-03-09 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rspec
18
- requirement: &84896850 !ruby/object:Gem::Requirement
17
+ requirement: &2156208200 !ruby/object:Gem::Requirement
19
18
  none: false
20
19
  requirements:
21
20
  - - ~>
22
21
  - !ruby/object:Gem::Version
23
- version: '2.6'
22
+ version: 2.8.0
24
23
  type: :development
25
24
  prerelease: false
26
- version_requirements: *84896850
25
+ version_requirements: *2156208200
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: rake
29
- requirement: &84896660 !ruby/object:Gem::Requirement
28
+ requirement: &2156206880 !ruby/object:Gem::Requirement
30
29
  none: false
31
30
  requirements:
32
31
  - - ! '>='
@@ -34,10 +33,10 @@ dependencies:
34
33
  version: '0'
35
34
  type: :development
36
35
  prerelease: false
37
- version_requirements: *84896660
36
+ version_requirements: *2156206880
38
37
  - !ruby/object:Gem::Dependency
39
38
  name: bundler
40
- requirement: &84896430 !ruby/object:Gem::Requirement
39
+ requirement: &2156204720 !ruby/object:Gem::Requirement
41
40
  none: false
42
41
  requirements:
43
42
  - - ! '>='
@@ -45,7 +44,18 @@ dependencies:
45
44
  version: '0'
46
45
  type: :development
47
46
  prerelease: false
48
- version_requirements: *84896430
47
+ version_requirements: *2156204720
48
+ - !ruby/object:Gem::Dependency
49
+ name: simplecov
50
+ requirement: &2156219360 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: 0.6.1
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *2156219360
49
59
  description: Simple gem to check hierarchically dependent "facts" about objects
50
60
  email:
51
61
  - alexisowl+fact_checker@gmail.com
@@ -56,7 +66,7 @@ files:
56
66
  - .gitignore
57
67
  - .rvmrc
58
68
  - Gemfile
59
- - README
69
+ - README.md
60
70
  - Rakefile
61
71
  - examples/README.md
62
72
  - examples/basic.rb
@@ -72,7 +82,6 @@ files:
72
82
  - spec/spec_helper.rb
73
83
  - spec/support/classes_with_facts.rb
74
84
  - spec/support/shared_facts_behaviour.rb
75
- has_rdoc: true
76
85
  homepage: https://github.com/alexis/fact_checker
77
86
  licenses: []
78
87
  post_install_message:
@@ -93,8 +102,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
102
  version: 1.3.5
94
103
  requirements: []
95
104
  rubyforge_project: fact_checker
96
- rubygems_version: 1.6.2
105
+ rubygems_version: 1.8.17
97
106
  signing_key:
98
107
  specification_version: 3
99
108
  summary: Checks facts which may depend on other facts
100
- test_files: []
109
+ test_files:
110
+ - spec/fact_checker/base_spec.rb
111
+ - spec/fact_checker/version_spec.rb
112
+ - spec/fact_checker_inheritance_spec.rb
113
+ - spec/fact_checker_spec.rb
114
+ - spec/spec.rake
115
+ - spec/spec_helper.rb
116
+ - spec/support/classes_with_facts.rb
117
+ - spec/support/shared_facts_behaviour.rb
data/README DELETED
@@ -1,23 +0,0 @@
1
- 1. What is FactChecker
2
-
3
- Simple ruby gem to check hierarchically dependent "facts" about objects.
4
-
5
- 2. Getting started
6
-
7
- 2.1 Installation
8
-
9
- gem install fact_checker
10
-
11
- 2.2 Usage
12
-
13
- https://github.com/alexis/fact_checker/tree/master/examples
14
-
15
- 3. Development / Contributing
16
-
17
- 3.1 Testing code with rspec
18
-
19
- rake spec
20
-
21
- 3.2 Testing code coverage with rcov for ruby 1.8
22
-
23
- rcov -Ilib:spec --exclude gem spec/fact_checker_spec.rb