core_extended 0.0.1 → 0.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.
@@ -12,7 +12,7 @@ class String
12
12
  alias_method :upcase_ignoring_accents!, :upcase!
13
13
  def upcase!
14
14
  ACCENTS_MAPPING.each { |map| tr! map[:downcase], map[:upcase] }
15
- upcase_ignoring_accents!
15
+ upcase_ignoring_accents! || self
16
16
  end
17
17
 
18
18
  def upcase
@@ -22,7 +22,7 @@ class String
22
22
  alias_method :downcase_ignoring_accents!, :downcase!
23
23
  def downcase!
24
24
  ACCENTS_MAPPING.each { |map| tr! map[:upcase], map[:downcase] }
25
- downcase_ignoring_accents!
25
+ downcase_ignoring_accents! || self
26
26
  end
27
27
 
28
28
  def downcase
@@ -1,3 +1,3 @@
1
1
  module CoreExtended
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/spec/string_spec.rb CHANGED
@@ -5,14 +5,18 @@ describe String do
5
5
 
6
6
  describe 'Upcase' do
7
7
 
8
- it 'With accents' do
9
- 'áèïôu'.upcase.must_equal 'ÁÈÏÔU'
8
+ it 'Only accented' do
9
+ 'áÈïÔú'.upcase.must_equal 'ÁÈÏÔÚ'
10
10
  end
11
11
 
12
12
  it 'Without accents' do
13
13
  'aEiOu'.upcase.must_equal 'AEIOU'
14
14
  end
15
15
 
16
+ it 'Mixed' do
17
+ 'áEïÔu'.upcase.must_equal 'ÁEÏÔU'
18
+ end
19
+
16
20
  it 'Change itself' do
17
21
  string = 'áèiÖU'
18
22
  string.upcase!.must_equal 'ÁÈIÖU'
@@ -23,14 +27,18 @@ describe String do
23
27
 
24
28
  describe 'Downcase' do
25
29
 
26
- it 'With accents' do
27
- 'ÁÈÏÔU'.downcase.must_equal 'áèïôu'
30
+ it 'Only accented' do
31
+ 'áÈïÔú'.downcase.must_equal 'áèïôú'
28
32
  end
29
33
 
30
34
  it 'Without accents' do
31
35
  'aEiOu'.downcase.must_equal 'aeiou'
32
36
  end
33
37
 
38
+ it 'Mixed' do
39
+ 'áEïÔu'.downcase.must_equal 'áeïôu'
40
+ end
41
+
34
42
  it 'Change itself' do
35
43
  string = 'ÁÈIöu'
36
44
  string.downcase!.must_equal 'áèiöu'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: core_extended
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: