div_by_3 1.0.1 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9c2bf61e9743da9ff4d91794a44e774ebe5180f
4
- data.tar.gz: 71fa260bf982548d1d6637736e18249bb7bf81aa
3
+ metadata.gz: 738ff70503ae3e2fe564a1e38c93096a91cd7790
4
+ data.tar.gz: 3c749d4206a92fbc7f3206b828eddc44d12bfd48
5
5
  SHA512:
6
- metadata.gz: 0dcffc361377c8aa073a2b46c3163fc739912ac0dd04bad6ca72bfb84c080a8e6e1434ddab6554f48c62844062a9debba26d17c217c932266496bd59df78a39a
7
- data.tar.gz: c9aa95da9ac3e7f477dba04761fac600f1d258f171b199dd648f03854fab4050522df35b2cefdebac336bea1825cc3c08cc40dedccecca413811846f02ac7fc1
6
+ metadata.gz: 4b121be11413143b6d13a09a1993d385e972474155ce159602038cb14976bdc14016a0bfbe912ac47f5acd3bff4539be0924a8e325b8939bd3169b2eeb328d2d
7
+ data.tar.gz: 1976f80763cfcd2097713b2c0799e2d90911714893570c5e38840a9a29be05b8ede82bffc7036f6c17de4aa2d9dca051f603881cd4fc95595fd11af35a821cb3
data/History.txt CHANGED
@@ -1,4 +1,4 @@
1
- === 1.0.1 / 2016-08-28
1
+ === 1.0.2 / 2016-08-29
2
2
 
3
3
  * 1 major enhancement
4
4
 
@@ -7,3 +7,7 @@
7
7
  * 1 minor enhancement
8
8
 
9
9
  * Some corrections
10
+
11
+ * 1 minor correction
12
+
13
+ * changes _with_ to _by_
data/lib/div_by_3.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  class DivBy_3
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
4
4
 
5
- def div_with_3(arg)
5
+ def div_by_3(arg)
6
6
  raise TypeError unless [Fixnum, Bignum].include?(arg.class)
7
7
  (arg.to_s.split('').map(&:to_i).reduce { |a, e| a + e } % 3).zero?
8
8
  end
@@ -8,37 +8,37 @@ require "div_by_3"
8
8
  end
9
9
 
10
10
  def test_valid_val
11
- assert div_with_3(123)
11
+ assert div_by_3(123)
12
12
  end
13
13
 
14
14
  def test_valid_val_zero
15
- assert div_with_3(0)
15
+ assert div_by_3(0)
16
16
  end
17
17
 
18
18
  def test_valid_val_negative
19
- refute div_with_3(-2)
19
+ refute div_by_3(-2)
20
20
  end
21
21
 
22
22
 
23
23
  def test_valid_val_but_false
24
- refute div_with_3(223)
24
+ refute div_by_3(223)
25
25
  end
26
26
 
27
27
  def test_invalid_string
28
- assert_raises(TypeError) { div_with_3("123") }
28
+ assert_raises(TypeError) { div_by_3("123") }
29
29
  end
30
30
 
31
31
  def test_invalid_array
32
- assert_raises(TypeError){ div_with_3([123])}
32
+ assert_raises(TypeError){ div_by_3([123])}
33
33
  end
34
34
 
35
35
 
36
36
  def test_valid_val_very_big_false
37
- refute div_with_3(1231123232445353645667657567575)
37
+ refute div_by_3(1231123232445353645667657567575)
38
38
  end
39
39
 
40
40
  def test_valid_val_very_big_true
41
- assert div_with_3(1231123232445353645667657567576)
41
+ assert div_by_3(1231123232445353645667657567576)
42
42
  end
43
43
 
44
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: div_by_3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fredrik Svärd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-28 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc