Skip to content

Commit

Permalink
fix: rename incorrect named method
Browse files Browse the repository at this point in the history
clear_deprecated_unicode_characters -> clear_unicode_separator_characters

https://jira.railsc.ru/browse/SERVICES-1040
  • Loading branch information
Korotaev Danil committed Jun 3, 2016
1 parent eb8154b commit 739cdac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/string_tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ def clear_control_characters(string)
string.tr("\u0000-\u001f", '')
end

# Public: вычищает устаревшие Unicode символы из строки
# Public: вычищает Unicode символы-разделители из строки
#
# string - String строка, из которой удаляем символы
#
# Returns String
def clear_deprecated_unicode_characters(string)
def clear_unicode_separator_characters(string)
string.tr("\u2028-\u2029", '')
end

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions spec/string_tools_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
end
end

describe '#clear_deprecated_unicode_characters' do
subject(:clear_deprecated_unicode_characters) { described_class.clear_deprecated_unicode_characters(string) }
describe '#clear_unicode_separator_characters' do
subject(:clear_unicode_separator_characters) { described_class.clear_unicode_separator_characters(string) }

context 'string with \u2029\u2029 symbols' do
let(:string) { File.open('spec/fixtures/lsps.txt', &:readline) }
let(:string) { File.open('spec/fixtures/separator_characters.txt', &:readline) }

it { expect(clear_deprecated_unicode_characters).to eq('indissolublestring') }
it { expect(clear_unicode_separator_characters).to eq('indissolublestring') }
end
end

Expand Down

0 comments on commit 739cdac

Please sign in to comment.