leap 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{leap}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andy Rossmeissl", "Seamus Abshere"]
@@ -11,5 +11,12 @@ module Leap
11
11
  def [](characteristic)
12
12
  characteristics[characteristic]
13
13
  end
14
+
15
+ def compliance
16
+ reports.map(&:quorum).map(&:compliance).inject do |memo, c|
17
+ next c unless memo
18
+ memo & c
19
+ end
20
+ end
14
21
  end
15
22
  end
@@ -65,7 +65,7 @@ class Person
65
65
  end
66
66
 
67
67
  committee :litmus do
68
- quorum 'litmus', :appreciates => :dummy do |characteristics|
68
+ quorum 'litmus', :appreciates => :dummy, :complies => :ipa do |characteristics|
69
69
  characteristics
70
70
  end
71
71
  end
@@ -9,6 +9,11 @@ class TestLeap < Test::Unit::TestCase
9
9
  should 'still have a lucky number' do
10
10
  assert_equal 0, @person.lucky_number
11
11
  end
12
+
13
+ should 'naturally receive an International Psychics Association-compliant lucky number' do
14
+ @person.lucky_number
15
+ assert_equal [:ipa], @person.deliberations[:lucky_number].compliance
16
+ end
12
17
  end
13
18
 
14
19
  context "An aged person" do
@@ -34,6 +39,11 @@ class TestLeap < Test::Unit::TestCase
34
39
  @person.lucky_number # make the decision
35
40
  assert_equal({}, @person.deliberations[:lucky_number].reports.find{ |r| r.committee.name == :litmus }.conclusion)
36
41
  end
42
+
43
+ should 'not receive an International Psychics Association-compliant lucky number unless he asks for it' do
44
+ @person.lucky_number
45
+ assert_equal [], @person.deliberations[:lucky_number].compliance
46
+ end
37
47
  end
38
48
 
39
49
  context "A clever aged person" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 0
9
- version: 0.4.0
8
+ - 1
9
+ version: 0.4.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andy Rossmeissl