summaryrefslogtreecommitdiff
path: root/spec/ruby/library/rexml/text/indent_text_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/rexml/text/indent_text_spec.rb')
-rw-r--r--spec/ruby/library/rexml/text/indent_text_spec.rb35
1 files changed, 19 insertions, 16 deletions
diff --git a/spec/ruby/library/rexml/text/indent_text_spec.rb b/spec/ruby/library/rexml/text/indent_text_spec.rb
index 1b0ee5ab16..16cba7faf6 100644
--- a/spec/ruby/library/rexml/text/indent_text_spec.rb
+++ b/spec/ruby/library/rexml/text/indent_text_spec.rb
@@ -1,23 +1,26 @@
require_relative '../../../spec_helper'
-require 'rexml/document'
-describe "REXML::Text#indent_text" do
- before :each do
- @t = REXML::Text.new("")
- end
- it "indents a string with default parameters" do
- @t.indent_text("foo").should == "\tfoo"
- end
+ruby_version_is ''...'2.8' do
+ require 'rexml/document'
- it "accepts a custom indentation level as second argument" do
- @t.indent_text("foo", 2, "\t", true).should == "\t\tfoo"
- end
+ describe "REXML::Text#indent_text" do
+ before :each do
+ @t = REXML::Text.new("")
+ end
+ it "indents a string with default parameters" do
+ @t.indent_text("foo").should == "\tfoo"
+ end
- it "accepts a custom separator as third argument" do
- @t.indent_text("foo", 1, "\n", true).should == "\nfoo"
- end
+ it "accepts a custom indentation level as second argument" do
+ @t.indent_text("foo", 2, "\t", true).should == "\t\tfoo"
+ end
+
+ it "accepts a custom separator as third argument" do
+ @t.indent_text("foo", 1, "\n", true).should == "\nfoo"
+ end
- it "accepts a fourth parameter to skip the first line" do
- @t.indent_text("foo", 1, "\t", false).should == "foo"
+ it "accepts a fourth parameter to skip the first line" do
+ @t.indent_text("foo", 1, "\t", false).should == "foo"
+ end
end
end