Sha256: ec37a6d248670c0dcd82281d19df588969d877bdd7f48c25490b03a77df7e91c

Contents?: true

Size: 419 Bytes

Versions: 5

Compression:

Stored size: 419 Bytes

Contents

require 'rexml/document'

describe "REXML::Attribute#to_string" do
  it "returns the attribute as XML" do
    attr = REXML::Attribute.new("name", "value")
    attr_empty = REXML::Attribute.new("name")
    attr_ns = REXML::Attribute.new("xmlns:ns", "http://uri")

    attr.to_string.should == "name='value'"
    attr_empty.to_string.should == "name=''"
    attr_ns.to_string.should == "xmlns:ns='http://uri'"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubysl-rexml-2.0.4 spec/attribute/to_string_spec.rb
rubysl-rexml-2.0.3 spec/attribute/to_string_spec.rb
rubysl-rexml-1.0.0 spec/attribute/to_string_spec.rb
rubysl-rexml-2.0.2 spec/attribute/to_string_spec.rb
rubysl-rexml-2.0.1 spec/attribute/to_string_spec.rb