diff options
Diffstat (limited to 'spec/ruby/library/rexml/document/root_spec.rb')
-rw-r--r-- | spec/ruby/library/rexml/document/root_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/ruby/library/rexml/document/root_spec.rb b/spec/ruby/library/rexml/document/root_spec.rb new file mode 100644 index 0000000000..55be68da6f --- /dev/null +++ b/spec/ruby/library/rexml/document/root_spec.rb @@ -0,0 +1,12 @@ +require 'rexml/document' +require File.expand_path('../../../../spec_helper', __FILE__) + +describe "REXML::Document#root" do + it "returns document root tag name" do + REXML::Document.new("<foo/>").root.name.should == "foo" + end + + it "returns nil if there is not root" do + REXML::Document.new.root.should == nil + end +end |