health_stats 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/health_stats.gemspec +1 -1
- data/lib/health_stats.rb +1 -4
- data/pkg/health_stats-0.0.1.gem +0 -0
- data/spec/spec_health_stats.rb +0 -15
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/health_stats.gemspec
CHANGED
data/lib/health_stats.rb
CHANGED
@@ -3,10 +3,7 @@ module HealthStats
|
|
3
3
|
RequiredAttributes = [:dob, :weight, :height, :gender]
|
4
4
|
|
5
5
|
RequiredAttributes.each do |attribute|
|
6
|
-
define_method(attribute)
|
7
|
-
message = "#{attribute} is not implemented"
|
8
|
-
raise HealthStats::AttributeError, message
|
9
|
-
end
|
6
|
+
define_method(attribute) { nil }
|
10
7
|
end
|
11
8
|
end
|
12
9
|
|
data/pkg/health_stats-0.0.1.gem
CHANGED
Binary file
|
data/spec/spec_health_stats.rb
CHANGED
@@ -5,21 +5,6 @@ require 'activesupport'
|
|
5
5
|
REQUIRED_ATTRIBUTES = [:height, :weight, :gender, :dob]
|
6
6
|
|
7
7
|
describe 'HealthStats' do
|
8
|
-
describe 'required attributes' do
|
9
|
-
before do
|
10
|
-
@klass = Class.new do
|
11
|
-
include HealthStats
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
REQUIRED_ATTRIBUTES.each do |attribute|
|
16
|
-
it "should include #{attribute}" do
|
17
|
-
person = @klass.new
|
18
|
-
lambda { person.send(attribute) }.should.raise(HealthStats::AttributeError)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
8
|
describe 'included methods' do
|
24
9
|
before do
|
25
10
|
@klass = Class.new do
|