Permalink
Browse files

utf8 symbols should be treated as such

  • Loading branch information...
1 parent aec50a8 commit a73a1c11f13590dccb975ba4348a04423c009453 @carlhoerberg committed Jul 3, 2012
Showing with 20 additions and 1 deletion.
  1. +20 −1 core/symbol/encoding_spec.rb
@@ -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.