ruby-watchr 0.1.3 → 0.1.4

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/lib/watchr/rating.rb CHANGED
@@ -5,8 +5,8 @@ module Watchr
5
5
  def rating
6
6
  total = smells.reduce(0) {|total, smell| total += rate(smell)}
7
7
 
8
- [100, 60, 40, 20, 10].each_with_index do |limit, i|
9
- return %w(F E D C B A)[i] if total > limit
8
+ [250, 180, 120, 70, 30, 0].each_with_index do |limit, i|
9
+ return %w(F E D C B A)[i] if total >= limit
10
10
  end
11
11
  end
12
12
 
@@ -1,3 +1,3 @@
1
1
  module Watchr
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -27,6 +27,13 @@ describe Watchr::Rating do
27
27
  describe '#rating' do
28
28
  subject { analyse.rating }
29
29
 
30
- it { should == 'F' }
30
+ context 'C' do
31
+ it { should == 'C' }
32
+ end
33
+
34
+ context 'A' do
35
+ let(:smells) { [] }
36
+ it { should == 'A' }
37
+ end
31
38
  end
32
39
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Petr Janda
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-07-08 00:00:00 +02:00
17
+ date: 2012-07-09 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency