File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ def wrap(length = 80)
16
16
strip!
17
17
split ( "\n " ) . collect! do |line |
18
18
if line . length > length
19
- line . gsub! ( /([^\s ]{#{ length } })([^\s $])/ , "\\ 1 \\ 2" )
20
19
line . gsub ( /(.{1,#{ length } })(\s +|$)/ , "\\ 1\n " ) . rstrip
21
20
else
22
21
line
Original file line number Diff line number Diff line change 20
20
it "wraps the string to the specified length" do
21
21
expect ( subject . wrap 30 ) . to eq "a long line of text that is\n going to be wrapped, fingers\n crossed!"
22
22
end
23
- end
24
23
24
+ # GH-79
25
+ context "with an uninterrupted string" do
26
+ subject { "a long line of text with a nice uninterrupted-string-like-a-url-for-example" }
27
+ it "does not break the uninterrupted portion" do
28
+ expect ( subject . wrap 30 ) . to eq "a long line of text with a\n nice\n uninterrupted-string-like-a-url-for-example"
29
+ end
30
+ end
31
+ end
25
32
26
33
describe '#to_underscore' do
27
34
subject { "Some String" }
You can’t perform that action at this time.
0 commit comments