Sha256: 7959186425e5a54f617f68a78823f39fa958d496e16e3a2e7f337c6c92ab24cd

Contents?: true

Size: 551 Bytes

Versions: 49

Compression:

Stored size: 551 Bytes

Contents

require File.expand_path('../../../../spec_helper', __FILE__)
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

49 entries across 49 versions & 2 rubygems

Version Path
rhodes-7.6.0 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-7.5.1 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-7.4.1 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-7.1.17 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-6.2.0 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-6.0.11 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-5.5.18 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-5.5.17 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-5.5.15 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-5.5.2 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-5.5.0 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-3.3.5 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb
rhodes-3.4.2 spec/framework_spec/app/spec/library/rexml/text/wrap_spec.rb