summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/shared/to_sym.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/shared/to_sym.rb')
-rw-r--r--spec/ruby/core/string/shared/to_sym.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/ruby/core/string/shared/to_sym.rb b/spec/ruby/core/string/shared/to_sym.rb
index 833eae100e..2a8a2e3182 100644
--- a/spec/ruby/core/string/shared/to_sym.rb
+++ b/spec/ruby/core/string/shared/to_sym.rb
@@ -1,42 +1,42 @@
describe :string_to_sym, shared: true do
it "returns the symbol corresponding to self" do
- "Koala".send(@method).should equal :Koala
- 'cat'.send(@method).should equal :cat
- '@cat'.send(@method).should equal :@cat
- 'cat and dog'.send(@method).should equal :"cat and dog"
- "abc=".send(@method).should equal :abc=
+ "Koala".send(@method).should.equal? :Koala
+ 'cat'.send(@method).should.equal? :cat
+ '@cat'.send(@method).should.equal? :@cat
+ 'cat and dog'.send(@method).should.equal? :"cat and dog"
+ "abc=".send(@method).should.equal? :abc=
end
it "does not special case +(binary) and -(binary)" do
- "+(binary)".send(@method).should equal :"+(binary)"
- "-(binary)".send(@method).should equal :"-(binary)"
+ "+(binary)".send(@method).should.equal? :"+(binary)"
+ "-(binary)".send(@method).should.equal? :"-(binary)"
end
it "does not special case certain operators" do
- "!@".send(@method).should equal :"!@"
- "~@".send(@method).should equal :"~@"
- "!(unary)".send(@method).should equal :"!(unary)"
- "~(unary)".send(@method).should equal :"~(unary)"
- "+(unary)".send(@method).should equal :"+(unary)"
- "-(unary)".send(@method).should equal :"-(unary)"
+ "!@".send(@method).should.equal? :"!@"
+ "~@".send(@method).should.equal? :"~@"
+ "!(unary)".send(@method).should.equal? :"!(unary)"
+ "~(unary)".send(@method).should.equal? :"~(unary)"
+ "+(unary)".send(@method).should.equal? :"+(unary)"
+ "-(unary)".send(@method).should.equal? :"-(unary)"
end
it "returns a US-ASCII Symbol for a UTF-8 String containing only US-ASCII characters" do
sym = "foobar".send(@method)
sym.encoding.should == Encoding::US_ASCII
- sym.should equal :"foobar"
+ sym.should.equal? :"foobar"
end
it "returns a US-ASCII Symbol for a binary String containing only US-ASCII characters" do
sym = "foobar".b.send(@method)
sym.encoding.should == Encoding::US_ASCII
- sym.should equal :"foobar"
+ sym.should.equal? :"foobar"
end
it "returns a UTF-8 Symbol for a UTF-8 String containing non US-ASCII characters" do
sym = "il était une fois".send(@method)
sym.encoding.should == Encoding::UTF_8
- sym.should equal :"il était une #{'fois'}"
+ sym.should.equal? :"il était une #{'fois'}"
end
it "returns a UTF-16LE Symbol for a UTF-16LE String containing non US-ASCII characters" do
@@ -67,6 +67,6 @@ describe :string_to_sym, shared: true do
invalid_utf8.should_not.valid_encoding?
-> {
invalid_utf8.send(@method)
- }.should raise_error(EncodingError, 'invalid symbol in encoding UTF-8 :"\xC3"')
+ }.should.raise(EncodingError, 'invalid symbol in encoding UTF-8 :"\xC3"')
end
end