diff options
Diffstat (limited to 'spec/ruby/library/rexml/text')
-rw-r--r-- | spec/ruby/library/rexml/text/append_spec.rb | 13 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/clone_spec.rb | 13 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/comparison_spec.rb | 28 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/empty_spec.rb | 15 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/indent_text_spec.rb | 26 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/inspect_spec.rb | 11 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/new_spec.rb | 51 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/node_type_spec.rb | 11 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/normalize_spec.rb | 11 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/read_with_substitution_spec.rb | 15 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/to_s_spec.rb | 20 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/unnormalize_spec.rb | 11 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/value_spec.rb | 40 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/wrap_spec.rb | 23 | ||||
-rw-r--r-- | spec/ruby/library/rexml/text/write_with_substitution_spec.rb | 36 |
15 files changed, 0 insertions, 324 deletions
diff --git a/spec/ruby/library/rexml/text/append_spec.rb b/spec/ruby/library/rexml/text/append_spec.rb deleted file mode 100644 index 5e7a5bae7c..0000000000 --- a/spec/ruby/library/rexml/text/append_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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 -end diff --git a/spec/ruby/library/rexml/text/clone_spec.rb b/spec/ruby/library/rexml/text/clone_spec.rb deleted file mode 100644 index 7801782ff5..0000000000 --- a/spec/ruby/library/rexml/text/clone_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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 -end diff --git a/spec/ruby/library/rexml/text/comparison_spec.rb b/spec/ruby/library/rexml/text/comparison_spec.rb deleted file mode 100644 index 119dd050a6..0000000000 --- a/spec/ruby/library/rexml/text/comparison_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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 -end diff --git a/spec/ruby/library/rexml/text/empty_spec.rb b/spec/ruby/library/rexml/text/empty_spec.rb deleted file mode 100644 index 4c9c899bcb..0000000000 --- a/spec/ruby/library/rexml/text/empty_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - require 'rexml/document' - - describe "REXML::Text#empty?" do - it "returns true if the text is empty" do - REXML::Text.new("").should.empty? - end - - it "returns false if the text is not empty" do - REXML::Text.new("some_text").should_not.empty? - end - end -end diff --git a/spec/ruby/library/rexml/text/indent_text_spec.rb b/spec/ruby/library/rexml/text/indent_text_spec.rb deleted file mode 100644 index 73065c37da..0000000000 --- a/spec/ruby/library/rexml/text/indent_text_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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 -end diff --git a/spec/ruby/library/rexml/text/inspect_spec.rb b/spec/ruby/library/rexml/text/inspect_spec.rb deleted file mode 100644 index af389890ee..0000000000 --- a/spec/ruby/library/rexml/text/inspect_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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 -end diff --git a/spec/ruby/library/rexml/text/new_spec.rb b/spec/ruby/library/rexml/text/new_spec.rb deleted file mode 100644 index 8b33da9294..0000000000 --- a/spec/ruby/library/rexml/text/new_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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("<&>", false, nil, true) - t.should == "<&>" - - ->{ 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}) - -> {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 == "<&>" - end - - it "escapes the values if raw is false" do - t = REXML::Text.new("<&>", false, nil, false) - t.should == "<&>" - end - end -end diff --git a/spec/ruby/library/rexml/text/node_type_spec.rb b/spec/ruby/library/rexml/text/node_type_spec.rb deleted file mode 100644 index f44a1ede3e..0000000000 --- a/spec/ruby/library/rexml/text/node_type_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - require 'rexml/document' - - describe "REXML::Text#node_type" do - it "returns :text" do - REXML::Text.new("test").node_type.should == :text - end - end -end diff --git a/spec/ruby/library/rexml/text/normalize_spec.rb b/spec/ruby/library/rexml/text/normalize_spec.rb deleted file mode 100644 index cde11ec3c9..0000000000 --- a/spec/ruby/library/rexml/text/normalize_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - require 'rexml/document' - - describe "REXML::Text.normalize" do - it "escapes a string with <, >, &, ' and \" " do - REXML::Text.normalize("< > & \" '").should == "< > & " '" - end - end -end diff --git a/spec/ruby/library/rexml/text/read_with_substitution_spec.rb b/spec/ruby/library/rexml/text/read_with_substitution_spec.rb deleted file mode 100644 index 7ff26f4d53..0000000000 --- a/spec/ruby/library/rexml/text/read_with_substitution_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - require 'rexml/document' - - describe "REXML::Text.read_with_substitution" do - it "reads a text and escapes entities" do - REXML::Text.read_with_substitution("< > & " '").should == "< > & \" '" - end - - it "accepts an regex for invalid expressions and raises an error if text matches" do - -> {REXML::Text.read_with_substitution("this is illegal", /illegal/)}.should raise_error(Exception) - end - end -end diff --git a/spec/ruby/library/rexml/text/to_s_spec.rb b/spec/ruby/library/rexml/text/to_s_spec.rb deleted file mode 100644 index e67632c9a1..0000000000 --- a/spec/ruby/library/rexml/text/to_s_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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 == "& < >" - end - end -end diff --git a/spec/ruby/library/rexml/text/unnormalize_spec.rb b/spec/ruby/library/rexml/text/unnormalize_spec.rb deleted file mode 100644 index 7b507194d0..0000000000 --- a/spec/ruby/library/rexml/text/unnormalize_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - require 'rexml/document' - - describe "REXML::Text.unnormalize" do - it "unescapes a string with the values defined in SETUTITSBUS" do - REXML::Text.unnormalize("< > & " '").should == "< > & \" '" - end - end -end diff --git a/spec/ruby/library/rexml/text/value_spec.rb b/spec/ruby/library/rexml/text/value_spec.rb deleted file mode 100644 index 53d40c765f..0000000000 --- a/spec/ruby/library/rexml/text/value_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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 == "<a>" - end - end -end diff --git a/spec/ruby/library/rexml/text/wrap_spec.rb b/spec/ruby/library/rexml/text/wrap_spec.rb deleted file mode 100644 index 331a8439e2..0000000000 --- a/spec/ruby/library/rexml/text/wrap_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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 -end diff --git a/spec/ruby/library/rexml/text/write_with_substitution_spec.rb b/spec/ruby/library/rexml/text/write_with_substitution_spec.rb deleted file mode 100644 index 840f141e3d..0000000000 --- a/spec/ruby/library/rexml/text/write_with_substitution_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -require_relative '../../../spec_helper' - -ruby_version_is ''...'3.0' do - 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 == "& < >" - end - end -end |