summaryrefslogtreecommitdiff
path: root/spec/rubyspec/library/rexml/attributes
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-20 20:18:52 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-20 20:18:52 +0000
commit1d15d5f08032acf1b7bceacbb450d617ff6e0931 (patch)
treea3785a79899302bc149e4a6e72f624ac27dc1f10 /spec/rubyspec/library/rexml/attributes
parent75bfc6440d595bf339007f4fb280fd4d743e89c1 (diff)
Move spec/rubyspec to spec/ruby for consistency
* Other ruby implementations use the spec/ruby directory. [Misc #13792] [ruby-core:82287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/rubyspec/library/rexml/attributes')
-rw-r--r--spec/rubyspec/library/rexml/attributes/add_spec.rb7
-rw-r--r--spec/rubyspec/library/rexml/attributes/append_spec.rb7
-rw-r--r--spec/rubyspec/library/rexml/attributes/delete_all_spec.rb31
-rw-r--r--spec/rubyspec/library/rexml/attributes/delete_spec.rb27
-rw-r--r--spec/rubyspec/library/rexml/attributes/each_attribute_spec.rb25
-rw-r--r--spec/rubyspec/library/rexml/attributes/each_spec.rb25
-rw-r--r--spec/rubyspec/library/rexml/attributes/element_reference_spec.rb19
-rw-r--r--spec/rubyspec/library/rexml/attributes/element_set_spec.rb26
-rw-r--r--spec/rubyspec/library/rexml/attributes/get_attribute_ns_spec.rb14
-rw-r--r--spec/rubyspec/library/rexml/attributes/get_attribute_spec.rb29
-rw-r--r--spec/rubyspec/library/rexml/attributes/initialize_spec.rb18
-rw-r--r--spec/rubyspec/library/rexml/attributes/length_spec.rb7
-rw-r--r--spec/rubyspec/library/rexml/attributes/namespaces_spec.rb6
-rw-r--r--spec/rubyspec/library/rexml/attributes/prefixes_spec.rb24
-rw-r--r--spec/rubyspec/library/rexml/attributes/shared/add.rb17
-rw-r--r--spec/rubyspec/library/rexml/attributes/shared/length.rb13
-rw-r--r--spec/rubyspec/library/rexml/attributes/size_spec.rb7
-rw-r--r--spec/rubyspec/library/rexml/attributes/to_a_spec.rb20
18 files changed, 0 insertions, 322 deletions
diff --git a/spec/rubyspec/library/rexml/attributes/add_spec.rb b/spec/rubyspec/library/rexml/attributes/add_spec.rb
deleted file mode 100644
index 72e3c4c823..0000000000
--- a/spec/rubyspec/library/rexml/attributes/add_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../shared/add', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#add" do
- it_behaves_like :rexml_attribute_add, :add
-end
diff --git a/spec/rubyspec/library/rexml/attributes/append_spec.rb b/spec/rubyspec/library/rexml/attributes/append_spec.rb
deleted file mode 100644
index 89f3fc3e81..0000000000
--- a/spec/rubyspec/library/rexml/attributes/append_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../shared/add', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#<<" do
- it_behaves_like :rexml_attribute_add, :<<
-end
diff --git a/spec/rubyspec/library/rexml/attributes/delete_all_spec.rb b/spec/rubyspec/library/rexml/attributes/delete_all_spec.rb
deleted file mode 100644
index f11f0d66a3..0000000000
--- a/spec/rubyspec/library/rexml/attributes/delete_all_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#delete_all" do
- before :each do
- @e = REXML::Element.new("root")
- end
-
- it "deletes all attributes that match name" do
- uri = REXML::Attribute.new("uri", "http://something")
- @e.attributes << uri
- @e.attributes.delete_all("uri")
- @e.attributes.should be_empty
- @e.attributes["uri"].should == nil
- end
-
- it "deletes all attributes that match name with a namespace" do
- ns_uri = REXML::Attribute.new("xmlns:uri", "http://something_here_too")
- @e.attributes << ns_uri
- @e.attributes.delete_all("xmlns:uri")
- @e.attributes.should be_empty
- @e.attributes["xmlns:uri"].should == nil
- end
-
- it "returns the removed attribute" do
- uri = REXML::Attribute.new("uri", "http://something_here_too")
- @e.attributes << uri
- attrs = @e.attributes.delete_all("uri")
- attrs.first.should == uri
- end
-end
diff --git a/spec/rubyspec/library/rexml/attributes/delete_spec.rb b/spec/rubyspec/library/rexml/attributes/delete_spec.rb
deleted file mode 100644
index 1c02e5c03b..0000000000
--- a/spec/rubyspec/library/rexml/attributes/delete_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#delete" do
- before :each do
- @e = REXML::Element.new("root")
- @name = REXML::Attribute.new("name", "Pepe")
- end
-
- it "takes an attribute name and deletes the attribute" do
- @e.attributes.delete("name")
- @e.attributes["name"].should be_nil
- @e.attributes.should be_empty
- end
-
- it "takes an Attribute and deletes it" do
- @e.attributes.delete(@name)
- @e.attributes["name"].should be_nil
- @e.attributes.should be_empty
- end
-
- it "returns the element with the attribute removed" do
- ret_val = @e.attributes.delete(@name)
- ret_val.should == @e
- ret_val.attributes.should be_empty
- end
-end
diff --git a/spec/rubyspec/library/rexml/attributes/each_attribute_spec.rb b/spec/rubyspec/library/rexml/attributes/each_attribute_spec.rb
deleted file mode 100644
index cd1649be21..0000000000
--- a/spec/rubyspec/library/rexml/attributes/each_attribute_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#each_attribute" do
- it "iterates over the attributes yielding actual Attribute objects" do
- e = REXML::Element.new("root")
- name = REXML::Attribute.new("name", "Joe")
- ns_uri = REXML::Attribute.new("xmlns:ns", "http://some_uri")
- e.add_attribute name
- e.add_attribute ns_uri
-
- attributes = []
-
- e.attributes.each_attribute do |attr|
- attributes << attr
- end
-
- attributes = attributes.sort_by {|a| a.name }
- attributes.first.should == name
- attributes.last.should == ns_uri
- end
-end
-
-
-
diff --git a/spec/rubyspec/library/rexml/attributes/each_spec.rb b/spec/rubyspec/library/rexml/attributes/each_spec.rb
deleted file mode 100644
index f49bc75c0d..0000000000
--- a/spec/rubyspec/library/rexml/attributes/each_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#each" do
- before :each do
- @e = REXML::Element.new("root")
- @name = REXML::Attribute.new("name", "Joe")
- @ns_uri = REXML::Attribute.new("xmlns:ns", "http://some_uri")
- @e.add_attribute @name
- @e.add_attribute @ns_uri
- end
-
- it "iterates over the attributes yielding expanded-name/value" do
- attributes = []
- @e.attributes.each do |attr|
- attr.should be_kind_of(Array)
- attributes << attr
- end
- attributes = attributes.sort_by {|a| a.first }
- attributes.first.should == ["name", "Joe"]
- attributes.last.should == ["xmlns:ns", "http://some_uri"]
- end
-end
-
-
diff --git a/spec/rubyspec/library/rexml/attributes/element_reference_spec.rb b/spec/rubyspec/library/rexml/attributes/element_reference_spec.rb
deleted file mode 100644
index 0e85ecafe8..0000000000
--- a/spec/rubyspec/library/rexml/attributes/element_reference_spec.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#[]" do
- before :each do
- @e = REXML::Element.new("root")
- @lang = REXML::Attribute.new("language", "english")
- @e.attributes << @lang
- end
-
- it "returns the value of an attribute" do
- @e.attributes["language"].should == "english"
- end
-
- it "returns nil if the attribute does not exist" do
- @e.attributes["chunky bacon"].should == nil
- end
-end
-
diff --git a/spec/rubyspec/library/rexml/attributes/element_set_spec.rb b/spec/rubyspec/library/rexml/attributes/element_set_spec.rb
deleted file mode 100644
index 659d259df6..0000000000
--- a/spec/rubyspec/library/rexml/attributes/element_set_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#[]=" do
- before :each do
- @e = REXML::Element.new("song")
- @name = REXML::Attribute.new("name", "Holy Smoke!")
- @e.attributes << @name
- end
-
- it "sets an attribute" do
- @e.attributes["author"] = "_why's foxes"
- @e.attributes["author"].should == "_why's foxes"
- end
-
- it "overwrites an existing attribute" do
- @e.attributes["name"] = "Chunky Bacon"
- @e.attributes["name"].should == "Chunky Bacon"
- end
-
- it "deletes an attribute is value is nil" do
- @e.attributes["name"] = nil
- @e.attributes.length.should == 0
- end
-end
-
diff --git a/spec/rubyspec/library/rexml/attributes/get_attribute_ns_spec.rb b/spec/rubyspec/library/rexml/attributes/get_attribute_ns_spec.rb
deleted file mode 100644
index f4aeb76378..0000000000
--- a/spec/rubyspec/library/rexml/attributes/get_attribute_ns_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#get_attribute_ns" do
- it "returns an attribute by name and namespace" do
- e = REXML::Element.new("root")
- attr = REXML::Attribute.new("xmlns:ns", "http://some_url")
- e.attributes << attr
- attr.prefix.should == "xmlns"
- # This might be a bug in Attribute, commenting until those specs
- # are ready
- # e.attributes.get_attribute_ns(attr.prefix, "name").should == "http://some_url"
- end
-end
diff --git a/spec/rubyspec/library/rexml/attributes/get_attribute_spec.rb b/spec/rubyspec/library/rexml/attributes/get_attribute_spec.rb
deleted file mode 100644
index b7d83f5944..0000000000
--- a/spec/rubyspec/library/rexml/attributes/get_attribute_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#get_attribute" do
- before :each do
- @e = REXML::Element.new("root")
- @name = REXML::Attribute.new("name", "Dave")
- @e.attributes << @name
- end
-
- it "fetches an attributes" do
- @e.attributes.get_attribute("name").should == @name
- end
-
- it "fetches an namespaced attribute" do
- ns_name = REXML::Attribute.new("im:name", "Murray")
- @e.attributes << ns_name
- @e.attributes.get_attribute("name").should == @name
- @e.attributes.get_attribute("im:name").should == ns_name
- end
-
- it "returns an Attribute" do
- @e.attributes.get_attribute("name").should be_kind_of(REXML::Attribute)
- end
-
- it "returns nil if it attribute does not exist" do
- @e.attributes.get_attribute("fake").should be_nil
- end
-end
diff --git a/spec/rubyspec/library/rexml/attributes/initialize_spec.rb b/spec/rubyspec/library/rexml/attributes/initialize_spec.rb
deleted file mode 100644
index 2bf59b1f76..0000000000
--- a/spec/rubyspec/library/rexml/attributes/initialize_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#initialize" do
- it "is auto initialized by Element" do
- e = REXML::Element.new "root"
- e.attributes.should be_kind_of(REXML::Attributes)
-
- e.attributes << REXML::Attribute.new("name", "Paul")
- e.attributes["name"].should == "Paul"
- end
-
- it "receives a parent node" do
- e = REXML::Element.new "root"
- e.attributes << REXML::Attribute.new("name", "Vic")
- e.attributes["name"].should == "Vic"
- end
-end
diff --git a/spec/rubyspec/library/rexml/attributes/length_spec.rb b/spec/rubyspec/library/rexml/attributes/length_spec.rb
deleted file mode 100644
index cd68461e34..0000000000
--- a/spec/rubyspec/library/rexml/attributes/length_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../shared/length', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#length" do
- it_behaves_like :rexml_attribute_length, :length
-end
diff --git a/spec/rubyspec/library/rexml/attributes/namespaces_spec.rb b/spec/rubyspec/library/rexml/attributes/namespaces_spec.rb
deleted file mode 100644
index 41486d0316..0000000000
--- a/spec/rubyspec/library/rexml/attributes/namespaces_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#namespaces" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/rexml/attributes/prefixes_spec.rb b/spec/rubyspec/library/rexml/attributes/prefixes_spec.rb
deleted file mode 100644
index 9eca67b5ff..0000000000
--- a/spec/rubyspec/library/rexml/attributes/prefixes_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#prefixes" do
- before :each do
- @e = REXML::Element.new("root")
- a1 = REXML::Attribute.new("xmlns:a", "bar")
- a2 = REXML::Attribute.new("xmlns:b", "bla")
- a3 = REXML::Attribute.new("xmlns:c", "baz")
- @e.attributes << a1
- @e.attributes << a2
- @e.attributes << a3
-
- @e.attributes << REXML::Attribute.new("xmlns", "foo")
- end
-
- it "returns an array with the prefixes of each attribute" do
- @e.attributes.prefixes.sort.should == ["a", "b", "c"]
- end
-
- it "does not include the default namespace" do
- @e.attributes.prefixes.include?("xmlns").should == false
- end
-end
diff --git a/spec/rubyspec/library/rexml/attributes/shared/add.rb b/spec/rubyspec/library/rexml/attributes/shared/add.rb
deleted file mode 100644
index 872f149f45..0000000000
--- a/spec/rubyspec/library/rexml/attributes/shared/add.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-describe :rexml_attribute_add, shared: true do
- before :each do
- @e = REXML::Element.new("root")
- @attr = REXML::Attributes.new(@e)
- @name = REXML::Attribute.new("name", "Joe")
- end
-
- it "adds an attribute" do
- @attr.send(@method, @name)
- @attr["name"].should == "Joe"
- end
-
- it "replaces an existing attribute" do
- @attr.send(@method, REXML::Attribute.new("name", "Bruce"))
- @attr["name"].should == "Bruce"
- end
-end
diff --git a/spec/rubyspec/library/rexml/attributes/shared/length.rb b/spec/rubyspec/library/rexml/attributes/shared/length.rb
deleted file mode 100644
index 94681882a6..0000000000
--- a/spec/rubyspec/library/rexml/attributes/shared/length.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require File.expand_path('../../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe :rexml_attribute_length, shared: true do
- it "returns the number of attributes" do
- e = REXML::Element.new("root")
- e.attributes.send(@method).should == 0
-
- e.attributes << REXML::Attribute.new("name", "John")
- e.attributes << REXML::Attribute.new("another_name", "Leo")
- e.attributes.send(@method).should == 2
- end
-end
diff --git a/spec/rubyspec/library/rexml/attributes/size_spec.rb b/spec/rubyspec/library/rexml/attributes/size_spec.rb
deleted file mode 100644
index 761fcc1d5b..0000000000
--- a/spec/rubyspec/library/rexml/attributes/size_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require File.expand_path('../shared/length', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#size" do
- it_behaves_like :rexml_attribute_length, :size
-end
diff --git a/spec/rubyspec/library/rexml/attributes/to_a_spec.rb b/spec/rubyspec/library/rexml/attributes/to_a_spec.rb
deleted file mode 100644
index a3de48cf1c..0000000000
--- a/spec/rubyspec/library/rexml/attributes/to_a_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require File.expand_path('../../../../spec_helper', __FILE__)
-require 'rexml/document'
-
-describe "REXML::Attributes#to_a" do
- it "returns an array with the attributes" do
- e = REXML::Element.new("root")
- name = REXML::Attribute.new("name", "Dave")
- last = REXML::Attribute.new("last_name", "Murray")
-
- e.attributes << name
- e.attributes << last
-
- e.attributes.to_a.sort{|a,b|a.to_s<=>b.to_s}.should == [name, last]
- end
-
- it "returns an empty array if it has no attributes" do
- REXML::Element.new("root").attributes.to_a.should == []
- end
-end
-