summaryrefslogtreecommitdiff
path: root/spec/ruby/library/rexml/element/clone_spec.rb
blob: d26392db4187f574c85d1270886924b298e6449a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'rexml/document'
require_relative '../../../spec_helper'

describe "REXML::Element#clone" do
  before :each do
    @e = REXML::Element.new "a"
  end
  it "creates a copy of element" do
    @e.clone.to_s.should == @e.to_s
  end

  it "copies the attributes" do
    @e.add_attribute("foo", "bar")
    @e.clone.to_s.should == @e.to_s
  end

  it "does not copy the text" do
    @e.add_text "some text..."
    @e.clone.to_s.should_not == @e
    @e.clone.to_s.should == "<a/>"
  end

  it "does not copy the child elements" do
    b = REXML::Element.new "b"
    @e << b
    @e.clone.should_not == @e
    @e.clone.to_s.should == "<a/>"
  end
end
dc4246732652'>ruby tool/update-deps --fixshyouhei 2017-03-09rbconfig/sizeof: remove VPATHnobu 2017-03-09rbconfig/sizeof: nmake VPATHnobu 2017-01-30make FIXNUM_MAX visible from Rubyshyouhei 2016-04-25rbconfig/sizeof: calculate at compilation timenobu 2016-04-11Update dependencies.akr 2016-01-22common.mk: source dependency for nmakenobu 2016-01-09nmake VPATHnobu 2016-01-09Revert r53482 "nmake VPATH"naruse 2016-01-09nmake VPATHnobu 2015-12-16handle ext/ as r53141naruse 2015-06-28sizes.c.tmpl: extract RUBY_DEFINTnobu 2015-06-17* ext/rbconfig/sizeof/extconf.rb: Check __float80.akr 2015-06-16* ext/rbconfig/sizeof/extconf.rb: Check several types defined in C99akr 2015-06-03* ext/rbconfig/sizeof/extconf.rb: Check C99 standard integer types.akr 2015-06-03* configure.in: Don't check __int128.akr 2014-12-19Update dependencies.akr 2014-11-27Update dependencies.akr 2014-11-21Update dependency.akr 2014-11-15Mark auogenerated part.akr 2014-11-15* common.mk: Remove comments in Dependency lines.akr 2014-11-15* tool/update-deps: Extend to fix dependencies.akr 2014-07-26rbconfig/sizeof: remove garbagenobu 2014-07-26rbconfig/sizeof: revert r46924nobu 2014-07-24* ext/rbconfig/sizeof/depend (sizes.c): fix build failure since r46924.ngoto 2014-07-24rbconfig/sizeof: VPATH prefixnobu 2014-07-05ext/rbconfig/sizeof: distcleannobu 2013-11-18ext/rbconfig/sizeof: move to an extension librarynobu