diff options
Diffstat (limited to 'spec/ruby/core/string/tr_s_spec.rb')
| -rw-r--r-- | spec/ruby/core/string/tr_s_spec.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/spec/ruby/core/string/tr_s_spec.rb b/spec/ruby/core/string/tr_s_spec.rb index dd72da440c..22a193ec4b 100644 --- a/spec/ruby/core/string/tr_s_spec.rb +++ b/spec/ruby/core/string/tr_s_spec.rb @@ -18,13 +18,11 @@ describe "String#tr_s" do "hello ^--^".tr_s("---", "_").should == "hello ^_^" end - ruby_bug "#19769", ""..."3.3" do - it "accepts c1-c1 notation to denote range of one character" do - "hello".tr_s('e-e', 'x').should == "hxllo" - "123456789".tr_s("2-23","xy").should == "1xy456789" - "hello ^-^".tr_s("e-", "a-a_").should == "hallo ^_^" - "hello ^-^".tr_s("---o", "_a").should == "hella ^_^" - end + it "accepts c1-c1 notation to denote range of one character" do + "hello".tr_s('e-e', 'x').should == "hxllo" + "123456789".tr_s("2-23","xy").should == "1xy456789" + "hello ^-^".tr_s("e-", "a-a_").should == "hallo ^_^" + "hello ^-^".tr_s("---o", "_a").should == "hella ^_^" end it "pads to_str with its last char if it is shorter than from_string" do @@ -56,7 +54,7 @@ describe "String#tr_s" do end it "returns String instances when called on a subclass" do - StringSpecs::MyString.new("hello").tr_s("e", "a").should be_an_instance_of(String) + StringSpecs::MyString.new("hello").tr_s("e", "a").should.instance_of?(String) end # http://redmine.ruby-lang.org/issues/show/1839 @@ -126,8 +124,8 @@ describe "String#tr_s!" do it "raises a FrozenError if self is frozen" do s = "hello".freeze - -> { s.tr_s!("el", "ar") }.should raise_error(FrozenError) - -> { s.tr_s!("l", "r") }.should raise_error(FrozenError) - -> { s.tr_s!("", "") }.should raise_error(FrozenError) + -> { s.tr_s!("el", "ar") }.should.raise(FrozenError) + -> { s.tr_s!("l", "r") }.should.raise(FrozenError) + -> { s.tr_s!("", "") }.should.raise(FrozenError) end end |
