Sha256: aa13c7c84be76e13cec86a57b0155d3754118459bb395711e548c12ea1332519

Contents?: true

Size: 489 Bytes

Versions: 5

Compression:

Stored size: 489 Bytes

Contents

require 'rexml/document'

describe "REXML::Text#wrap" do
  before :each do
    @t = REXML::Text.new("abc def")
  end

  it "wraps the text at width" do
    @t.wrap("abc def", 3, false).should == "abc\ndef"
  end

  it "returns the string if width is greater than the size of the string" do
    @t.wrap("abc def", 10, false).should == "abc def"
  end

  it "takes a newline at the beginning option as the third parameter"do
    @t.wrap("abc def", 3, true).should == "\nabc\ndef"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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