summaryrefslogtreecommitdiff
path: root/spec/ruby/library/rexml/document/version_spec.rb
blob: ca979dbf342a733fdddc4591de5f2ea999fd4986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'rexml/document'
require File.expand_path('../../../../spec_helper', __FILE__)

describe "REXML::Document#version" do
  it "returns XML version from declaration" do
    d = REXML::Document.new
    d.add REXML::XMLDecl.new("1.1")
    d.version.should == "1.1"
  end

  it "returns the default version when declaration is not present" do
    REXML::Document.new.version.should == REXML::XMLDecl::DEFAULT_VERSION
  end
end