-
-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utf8 symbols should be treated as such
- Loading branch information
1 parent
aec50a8
commit a73a1c1
Showing
1 changed file
with
20 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 |
---|---|---|
@@ -1,7 +1,26 @@ | ||
# encoding: utf-8 | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
ruby_version_is "1.9" do | ||
describe "Symbol#encoding" do | ||
it "needs to be reviewed for spec completeness" | ||
context "for ASCII symbols" do | ||
it "should be US-ASCII" do | ||
:foo.encoding.name.should == "US-ASCII" | ||
end | ||
|
||
it "should be US-ASCII after converting to string" do | ||
:foo.to_s.encoding.name.should == "US-ASCII" | ||
end | ||
end | ||
|
||
context "for UTF-8 symbols" do | ||
it "should be UTF-8" do | ||
:åäö.encoding.name.should == "UTF-8" | ||
end | ||
|
||
it "should be UTF-8 after converting to string" do | ||
:åäö.to_s.encoding.name.should == "UTF-8" | ||
end | ||
end | ||
end | ||
end |