mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
17 lines
515 B
Ruby
17 lines
515 B
Ruby
require_relative '../../../spec_helper'
|
|
|
|
ruby_version_is ''...'3.0' do
|
|
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
|
|
end
|