Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

UTF-8 symbols should be treated as such #144

Merged
merged 1 commit into from

2 participants

@carlhoerberg

MRI Ruby is passing, but JRuby is currently not. (jruby/jruby#201)

@nurse nurse merged commit e749866 into rubyspec:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 3, 2012
  1. @carlhoerberg
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 1 deletion.
  1. +20 −1 core/symbol/encoding_spec.rb
View
21 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
Something went wrong with that request. Please try again.