diff options
Diffstat (limited to 'spec/rubyspec/library/rexml/element/instructions_spec.rb')
-rw-r--r-- | spec/rubyspec/library/rexml/element/instructions_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/rubyspec/library/rexml/element/instructions_spec.rb b/spec/rubyspec/library/rexml/element/instructions_spec.rb new file mode 100644 index 0000000000..01a2374820 --- /dev/null +++ b/spec/rubyspec/library/rexml/element/instructions_spec.rb @@ -0,0 +1,21 @@ +require 'rexml/document' +require File.expand_path('../../../../spec_helper', __FILE__) + +describe "REXML::Element#instructions" do + before :each do + @elem = REXML::Element.new("root") + end + it "returns the Instruction children nodes" do + inst = REXML::Instruction.new("xml-stylesheet", "href='headlines.css'") + @elem << inst + @elem.instructions.first.should == inst + end + + it "returns an empty array if it has no Instruction children" do + @elem.instructions.should be_empty + end + + it "freezes the returned array" do + @elem.instructions.frozen?.should be_true + end +end |