Skip to content

Commit

Permalink
utf8 symbols should be treated as such
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed Jul 3, 2012
1 parent aec50a8 commit a73a1c1
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion core/symbol/encoding_spec.rb
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

0 comments on commit a73a1c1

Please sign in to comment.