ski_binding_calculator 0.6.9 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,17 +21,23 @@ class SkiBinding::Calculator
21
21
 
22
22
  if attrs[:weight].blank?
23
23
  error.add_message(*[:weight, "weight is blank"])
24
- elsif attrs[:height].blank?
24
+ end
25
+ if attrs[:height].blank?
25
26
  error.add_message(*[:height, "height is blank"])
26
- elsif attrs[:sole_length].blank?
27
+ end
28
+ if attrs[:sole_length].blank?
27
29
  error.add_message(*[:sole_length, "sole length is blank"])
28
- elsif attrs[:birthday_year].blank?
30
+ end
31
+ if attrs[:birthday_year].blank?
29
32
  error.add_message(*[:birthday_year, "birthday year is blank"])
30
- elsif attrs[:birthday_month].blank?
33
+ end
34
+ if attrs[:birthday_month].blank?
31
35
  error.add_message(*[:birthday_month, "birthday month is blank"])
32
- elsif attrs[:birthday_day].blank?
36
+ end
37
+ if attrs[:birthday_day].blank?
33
38
  error.add_message(*[:birthday_day, "birthday day is blank"])
34
- elsif attrs[:type].blank?
39
+ end
40
+ if attrs[:type].blank?
35
41
  error.add_message(*[:type, "type is blank"])
36
42
  end
37
43
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'ski_binding_calculator'
4
- s.version = '0.6.9'
4
+ s.version = '0.7.0'
5
5
  s.summary = "Ski Binding Calculator"
6
6
  s.description = "Calculates the z-value according to ISO 11088."
7
7
  s.authors = ["Jonas Ruef, Felix Langenegger"]
@@ -70,12 +70,9 @@ describe SkiBinding::Calculator do
70
70
  end
71
71
 
72
72
  it "raise error with two messages" do
73
- expect { calculated_attr_validation }.to raise_error(SkiBinding::Error) do |e|
74
- e.message.should == {:weight => "weight is blank", :height => "height is blank"}
75
- end
73
+ expect { calculated_attr_validation }.to raise_error(SkiBinding::Error) { |e|
74
+ e.messages.should == {:weight => "weight is blank", :height => "height is blank"} }
76
75
  end
77
- #it { expect { calculated_attr_validation }
78
- # .to raise_error(ArgumentError, "height is blank") }
79
76
  end
80
77
 
81
78
  describe "#prep_attributes" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ski_binding_calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.9
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: