Sha256: 79082e82b597da0759a32448b9908dccd842bf4cea297adf2d4343180400a5a9

Contents?: true

Size: 601 Bytes

Versions: 5

Compression:

Stored size: 601 Bytes

Contents

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

  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"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubysl-rexml-2.0.4 spec/text/indent_text_spec.rb
rubysl-rexml-2.0.3 spec/text/indent_text_spec.rb
rubysl-rexml-1.0.0 spec/text/indent_text_spec.rb
rubysl-rexml-2.0.2 spec/text/indent_text_spec.rb
rubysl-rexml-2.0.1 spec/text/indent_text_spec.rb