numb 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.6.1
data/lib/numb/harshad.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  class Integer
3
3
  def harshad?
4
- return false unless self >= 0
4
+ return false unless self >= 1
5
5
  (self % digital_sum) == 0
6
6
  end
7
7
  alias :niven? :harshad?
data/spec/harshad_spec.rb CHANGED
@@ -17,6 +17,10 @@ describe Integer, "#harshad?" do
17
17
  end
18
18
  end
19
19
 
20
+ it "returns false for 0" do
21
+ 0.should_not be_harshad
22
+ end
23
+
20
24
  it "returns false for negative numbers" do
21
25
  (1..204).each do |number|
22
26
  (-number).should_not be_harshad
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Run Paint Run Run