summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/rindex_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/rindex_spec.rb')
-rw-r--r--spec/ruby/core/string/rindex_spec.rb28
1 files changed, 13 insertions, 15 deletions
diff --git a/spec/ruby/core/string/rindex_spec.rb b/spec/ruby/core/string/rindex_spec.rb
index 98e36785e3..f74c0115cc 100644
--- a/spec/ruby/core/string/rindex_spec.rb
+++ b/spec/ruby/core/string/rindex_spec.rb
@@ -347,22 +347,20 @@ describe "String#rindex with Regexp" do
lambda { "str".rindex(/../, nil) }.should raise_error(TypeError)
end
- with_feature :encoding do
- it "returns the reverse character index of a multibyte character" do
- "ありがりがとう".rindex("が").should == 4
- "ありがりがとう".rindex(/が/).should == 4
- end
+ it "returns the reverse character index of a multibyte character" do
+ "ありがりがとう".rindex("が").should == 4
+ "ありがりがとう".rindex(/が/).should == 4
+ end
- it "returns the character index before the finish" do
- "ありがりがとう".rindex("が", 3).should == 2
- "ありがりがとう".rindex(/が/, 3).should == 2
- end
+ it "returns the character index before the finish" do
+ "ありがりがとう".rindex("が", 3).should == 2
+ "ありがりがとう".rindex(/が/, 3).should == 2
+ end
- it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
- re = Regexp.new "れ".encode(Encoding::EUC_JP)
- lambda do
- "あれ".rindex re
- end.should raise_error(Encoding::CompatibilityError)
- end
+ it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
+ re = Regexp.new "れ".encode(Encoding::EUC_JP)
+ lambda do
+ "あれ".rindex re
+ end.should raise_error(Encoding::CompatibilityError)
end
end