Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return string literal from the String#to_sym method. (#1835)
- Loading branch information
1 parent
3bd7e24
commit a7f2efc
Showing
2 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -647,7 +647,7 @@ def inspect | |
end | ||
|
||
def intern | ||
self | ||
`self.toString()` | ||
end | ||
|
||
def lines(separator = $/, &block) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'spec_helper' | ||
|
||
describe 'String#to_sym' do | ||
it 'returns a string literal' do | ||
str = "string" | ||
sym = str.to_sym | ||
`typeof(sym)`.should == 'string' | ||
end | ||
end |