summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/tr_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/tr_spec.rb')
-rw-r--r--spec/ruby/core/string/tr_spec.rb24
1 files changed, 11 insertions, 13 deletions
diff --git a/spec/ruby/core/string/tr_spec.rb b/spec/ruby/core/string/tr_spec.rb
index 75841a974f..cb57c3851e 100644
--- a/spec/ruby/core/string/tr_spec.rb
+++ b/spec/ruby/core/string/tr_spec.rb
@@ -17,13 +17,11 @@ describe "String#tr" do
"hello ^-^".tr("---", "_").should == "hello ^_^"
end
- ruby_bug "#19769", ""..."3.3" do
- it "accepts c1-c1 notation to denote range of one character" do
- "hello".tr('e-e', 'x').should == "hxllo"
- "123456789".tr("2-23","xy").should == "1xy456789"
- "hello ^-^".tr("e-", "a-a_").should == "hallo ^_^"
- "hello ^-^".tr("---o", "_a").should == "hella ^_^"
- end
+ it "accepts c1-c1 notation to denote range of one character" do
+ "hello".tr('e-e', 'x').should == "hxllo"
+ "123456789".tr("2-23","xy").should == "1xy456789"
+ "hello ^-^".tr("e-", "a-a_").should == "hallo ^_^"
+ "hello ^-^".tr("---o", "_a").should == "hella ^_^"
end
it "pads to_str with its last char if it is shorter than from_string" do
@@ -32,11 +30,11 @@ describe "String#tr" do
end
it "raises an ArgumentError a descending range in the replacement as containing just the start character" do
- -> { "hello".tr("a-y", "z-b") }.should raise_error(ArgumentError)
+ -> { "hello".tr("a-y", "z-b") }.should.raise(ArgumentError)
end
it "raises an ArgumentError a descending range in the source as empty" do
- -> { "hello".tr("l-a", "z") }.should raise_error(ArgumentError)
+ -> { "hello".tr("l-a", "z") }.should.raise(ArgumentError)
end
it "translates chars not in from_string when it starts with a ^" do
@@ -68,7 +66,7 @@ describe "String#tr" do
end
it "returns Stringinstances when called on a subclass" do
- StringSpecs::MyString.new("hello").tr("e", "a").should be_an_instance_of(String)
+ StringSpecs::MyString.new("hello").tr("e", "a").should.instance_of?(String)
end
# http://redmine.ruby-lang.org/issues/show/1839
@@ -121,8 +119,8 @@ describe "String#tr!" do
it "raises a FrozenError if self is frozen" do
s = "abcdefghijklmnopqR".freeze
- -> { s.tr!("cdefg", "12") }.should raise_error(FrozenError)
- -> { s.tr!("R", "S") }.should raise_error(FrozenError)
- -> { s.tr!("", "") }.should raise_error(FrozenError)
+ -> { s.tr!("cdefg", "12") }.should.raise(FrozenError)
+ -> { s.tr!("R", "S") }.should.raise(FrozenError)
+ -> { s.tr!("", "") }.should.raise(FrozenError)
end
end