summaryrefslogtreecommitdiff
path: root/spec/rubyspec/library/rexml/text
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/library/rexml/text')
-rw-r--r--spec/rubyspec/library/rexml/text/append_spec.rb10
-rw-r--r--spec/rubyspec/library/rexml/text/clone_spec.rb10
-rw-r--r--spec/rubyspec/library/rexml/text/comparison_spec.rb25
-rw-r--r--spec/rubyspec/library/rexml/text/empty_spec.rb12
-rw-r--r--spec/rubyspec/library/rexml/text/indent_text_spec.rb24
-rw-r--r--spec/rubyspec/library/rexml/text/inspect_spec.rb8
-rw-r--r--spec/rubyspec/library/rexml/text/new_spec.rb49
-rw-r--r--spec/rubyspec/library/rexml/text/node_type_spec.rb8
-rw-r--r--spec/rubyspec/library/rexml/text/normalize_spec.rb8
-rw-r--r--spec/rubyspec/library/rexml/text/read_with_substitution_spec.rb13
-rw-r--r--spec/rubyspec/library/rexml/text/to_s_spec.rb18
-rw-r--r--spec/rubyspec/library/rexml/text/unnormalize_spec.rb8
-rw-r--r--spec/rubyspec/library/rexml/text/value_spec.rb37
-rw-r--r--spec/rubyspec/library/rexml/text/wrap_spec.rb21
-rw-r--r--spec/rubyspec/library/rexml/text/write_with_substitution_spec.rb33
15 files changed, 0 insertions, 284 deletions
diff --git a/spec/rubyspec/library/rexml/text/append_spec.rb b/spec/rubyspec/library/rexml/text/append_spec.rb
deleted file mode 100644
index c8f73f9393..0000000000
--- a/spec/rubyspec/library/rexml/text/append_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#<<" do
- it "appends a string to this text node" do
- text = REXML::Text.new("foo")
- text << "bar"
- text.should == "foobar"
- end
-end
diff --git a/spec/rubyspec/library/rexml/text/clone_spec.rb b/spec/rubyspec/library/rexml/text/clone_spec.rb
deleted file mode 100644
index c7d16e0d85..0000000000
--- a/spec/rubyspec/library/rexml/text/clone_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#clone" do
- it "creates a copy of this node" do
- text = REXML::Text.new("foo")
- text.clone.should == "foo"
- text.clone.should == text
- end
-end
diff --git a/spec/rubyspec/library/rexml/text/comparison_spec.rb b/spec/rubyspec/library/rexml/text/comparison_spec.rb
deleted file mode 100644
index ba637ea37e..0000000000
--- a/spec/rubyspec/library/rexml/text/comparison_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#<=>" do
- before :each do
- @first = REXML::Text.new("abc")
- @last = REXML::Text.new("def")
- end
-
- it "returns -1 if lvalue is less than rvalue" do
- val = @first <=> @last
- val.should == -1
- end
-
- it "returns -1 if lvalue is greater than rvalue" do
- val = @last <=> @first
- val.should == 1
- end
-
- it "returns 0 if both values are equal" do
- tmp = REXML::Text.new("tmp")
- val = tmp <=> tmp
- val.should == 0
- end
-end
diff --git a/spec/rubyspec/library/rexml/text/empty_spec.rb b/spec/rubyspec/library/rexml/text/empty_spec.rb
deleted file mode 100644
index 7102e1586e..0000000000
--- a/spec/rubyspec/library/rexml/text/empty_spec.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#empty?" do
- it "returns true if the text is empty" do
- REXML::Text.new("").empty?.should == true
- end
-
- it "returns false if the text is not empty" do
- REXML::Text.new("some_text").empty?.should == false
- end
-end
diff --git a/spec/rubyspec/library/rexml/text/indent_text_spec.rb b/spec/rubyspec/library/rexml/text/indent_text_spec.rb
deleted file mode 100644
index 2aa908826b..0000000000
--- a/spec/rubyspec/library/rexml/text/indent_text_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#indent_text" do
- before :each do
- @t = REXML::Text.new("")
- end
- it "indents a string with default parameters" do
- @t.indent_text("foo").should == "\tfoo"
- end
-
- it "accepts a custom indentation level as second argument" do
- @t.indent_text("foo", 2, "\t", true).should == "\t\tfoo"
- end
-
- it "accepts a custom separator as third argument" do
- @t.indent_text("foo", 1, "\n", true).should == "\nfoo"
- end
-
- it "accepts a fourth parameter to skip the first line" do
- @t.indent_text("foo", 1, "\t", false).should == "foo"
- end
-end
-
diff --git a/spec/rubyspec/library/rexml/text/inspect_spec.rb b/spec/rubyspec/library/rexml/text/inspect_spec.rb
deleted file mode 100644
index 655e42fcdf..0000000000
--- a/spec/rubyspec/library/rexml/text/inspect_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#inspect" do
- it "inspects the string attribute as a string" do
- REXML::Text.new("a text").inspect.should == "a text".inspect
- end
-end
diff --git a/spec/rubyspec/library/rexml/text/new_spec.rb b/spec/rubyspec/library/rexml/text/new_spec.rb
deleted file mode 100644
index 0d7a750a1d..0000000000
--- a/spec/rubyspec/library/rexml/text/new_spec.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text.new" do
-
- it "creates a Text child node with no parent" do
- t = REXML::Text.new("test")
- t.should be_kind_of(REXML::Child)
- t.should == "test"
- t.parent.should == nil
- end
-
- it "respects whitespace if second argument is true" do
- t = REXML::Text.new("testing whitespace", true)
- t.should == "testing whitespace"
- t = REXML::Text.new(" ", true)
- t.should == " "
- end
-
- it "receives a parent as third argument" do
- e = REXML::Element.new("root")
- t = REXML::Text.new("test", false, e)
- t.parent.should == e
- e.to_s.should == "<root>test</root>"
- end
-
- it "expects escaped text if raw is true" do
- t = REXML::Text.new("&lt;&amp;&gt;", false, nil, true)
- t.should == "&lt;&amp;&gt;"
-
- lambda{ REXML::Text.new("<&>", false, nil, true)}.should raise_error(Exception)
- end
-
- it "uses raw value of the parent if raw is nil" do
- e1 = REXML::Element.new("root", nil, { raw: :all})
- lambda {REXML::Text.new("<&>", false, e1)}.should raise_error(Exception)
-
- e2 = REXML::Element.new("root", nil, { raw: []})
- e2.raw.should be_false
- t1 = REXML::Text.new("<&>", false, e2)
- t1.should == "&lt;&amp;&gt;"
- end
-
- it "escapes the values if raw is false" do
- t = REXML::Text.new("<&>", false, nil, false)
- t.should == "&lt;&amp;&gt;"
- end
-end
-
diff --git a/spec/rubyspec/library/rexml/text/node_type_spec.rb b/spec/rubyspec/library/rexml/text/node_type_spec.rb
deleted file mode 100644
index a1c51b5b91..0000000000
--- a/spec/rubyspec/library/rexml/text/node_type_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#node_type" do
- it "returns :text" do
- REXML::Text.new("test").node_type.should == :text
- end
-end
diff --git a/spec/rubyspec/library/rexml/text/normalize_spec.rb b/spec/rubyspec/library/rexml/text/normalize_spec.rb
deleted file mode 100644
index 1725c38146..0000000000
--- a/spec/rubyspec/library/rexml/text/normalize_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text.normalize" do
- it "escapes a string with <, >, &, ' and \" " do
- REXML::Text.normalize("< > & \" '").should == "&lt; &gt; &amp; &quot; &apos;"
- end
-end
diff --git a/spec/rubyspec/library/rexml/text/read_with_substitution_spec.rb b/spec/rubyspec/library/rexml/text/read_with_substitution_spec.rb
deleted file mode 100644
index 7e42c40248..0000000000
--- a/spec/rubyspec/library/rexml/text/read_with_substitution_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text.read_with_substitution" do
- it "reads a text and escapes entities" do
- REXML::Text.read_with_substitution("&lt; &gt; &amp; &quot; &apos;").should == "< > & \" '"
- end
-
- it "accepts an regex for invalid expressions and raises an error if text matches" do
- lambda {REXML::Text.read_with_substitution("this is illegal", /illegal/)}.should raise_error(Exception)
- end
-end
-
diff --git a/spec/rubyspec/library/rexml/text/to_s_spec.rb b/spec/rubyspec/library/rexml/text/to_s_spec.rb
deleted file mode 100644
index 94356ff075..0000000000
--- a/spec/rubyspec/library/rexml/text/to_s_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#to_s" do
- it "returns the string of this Text node" do
- u = REXML::Text.new("sean russell", false, nil, true)
- u.to_s.should == "sean russell"
-
- t = REXML::Text.new("some test text")
- t.to_s.should == "some test text"
- end
-
- it "escapes the text" do
- t = REXML::Text.new("& < >")
- t.to_s.should == "&amp; &lt; &gt;"
- end
-end
-
diff --git a/spec/rubyspec/library/rexml/text/unnormalize_spec.rb b/spec/rubyspec/library/rexml/text/unnormalize_spec.rb
deleted file mode 100644
index 6406589694..0000000000
--- a/spec/rubyspec/library/rexml/text/unnormalize_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text.unnormalize" do
- it "unescapes a string with the values defined in SETUTITSBUS" do
- REXML::Text.unnormalize("&lt; &gt; &amp; &quot; &apos;").should == "< > & \" '"
- end
-end
diff --git a/spec/rubyspec/library/rexml/text/value_spec.rb b/spec/rubyspec/library/rexml/text/value_spec.rb
deleted file mode 100644
index d14e8aca6b..0000000000
--- a/spec/rubyspec/library/rexml/text/value_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#value" do
- it "returns the text value of this node" do
- REXML::Text.new("test").value.should == "test"
- end
-
- it "does not escape entities" do
- REXML::Text.new("& \"").value.should == "& \""
- end
-
- it "follows the respect_whitespace attribute" do
- REXML::Text.new("test bar", false).value.should == "test bar"
- REXML::Text.new("test bar", true).value.should == "test bar"
- end
-
- it "ignores the raw attribute" do
- REXML::Text.new("sean russell", false, nil, true).value.should == "sean russell"
- end
-end
-
-describe "REXML::Text#value=" do
- before :each do
- @t = REXML::Text.new("new")
- end
-
- it "sets the text of the node" do
- @t.value = "another text"
- @t.to_s.should == "another text"
- end
-
- it "escapes entities" do
- @t.value = "<a>"
- @t.to_s.should == "&lt;a&gt;"
- end
-end
diff --git a/spec/rubyspec/library/rexml/text/wrap_spec.rb b/spec/rubyspec/library/rexml/text/wrap_spec.rb
deleted file mode 100644
index a56759b0f4..0000000000
--- a/spec/rubyspec/library/rexml/text/wrap_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#wrap" do
- before :each do
- @t = REXML::Text.new("abc def")
- end
-
- it "wraps the text at width" do
- @t.wrap("abc def", 3, false).should == "abc\ndef"
- end
-
- it "returns the string if width is greater than the size of the string" do
- @t.wrap("abc def", 10, false).should == "abc def"
- end
-
- it "takes a newline at the beginning option as the third parameter" do
- @t.wrap("abc def", 3, true).should == "\nabc\ndef"
- end
-end
-
diff --git a/spec/rubyspec/library/rexml/text/write_with_substitution_spec.rb b/spec/rubyspec/library/rexml/text/write_with_substitution_spec.rb
deleted file mode 100644
index e5f027f297..0000000000
--- a/spec/rubyspec/library/rexml/text/write_with_substitution_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Text#write_with_substitution" do
- before :each do
- @t = REXML::Text.new("test")
- @f = tmp("rexml_spec")
- @file = File.open(@f, "w+")
- end
-
- after :each do
- @file.close
- rm_r @f
- end
-
- it "writes out the input to a String" do
- s = ""
- @t.write_with_substitution(s, "some text")
- s.should == "some text"
- end
-
- it "writes out the input to an IO" do
- @t.write_with_substitution(@file, "some text")
- @file.rewind
- @file.gets.should == "some text"
- end
-
- it "escapes characters" do
- @t.write_with_substitution(@file, "& < >")
- @file.rewind
- @file.gets.should == "&amp; &lt; &gt;"
- end
-end