summaryrefslogtreecommitdiff
path: root/spec/rubyspec/library/rexml/cdata/shared/to_s.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/library/rexml/cdata/shared/to_s.rb')
-rw-r--r--spec/rubyspec/library/rexml/cdata/shared/to_s.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/rubyspec/library/rexml/cdata/shared/to_s.rb b/spec/rubyspec/library/rexml/cdata/shared/to_s.rb
new file mode 100644
index 0000000000..f8c4951c95
--- /dev/null
+++ b/spec/rubyspec/library/rexml/cdata/shared/to_s.rb
@@ -0,0 +1,11 @@
+describe :rexml_cdata_to_s, shared: true do
+ it "returns the contents of the CData" do
+ c = REXML::CData.new("some text")
+ c.send(@method).should == "some text"
+ end
+
+ it "does not escape text" do
+ c1 = REXML::CData.new("some& text\n")
+ c1.send(@method).should == "some& text\n"
+ end
+end