aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJon Moss <me@jonathanmoss.me>2016-11-19 10:30:57 -0500
committerJon Moss <me@jonathanmoss.me>2016-11-19 10:30:57 -0500
commit1d18b9b2fb48664074781aff7db6056058725458 (patch)
tree944b5534a2d75c78696f692b0de3c00af199fe74 /activesupport
parent4aacace550155faab98710c045f912db80601004 (diff)
downloadrails-1d18b9b2fb48664074781aff7db6056058725458.tar.gz
rails-1d18b9b2fb48664074781aff7db6056058725458.tar.bz2
rails-1d18b9b2fb48664074781aff7db6056058725458.zip
Do not include `ActiveSupport` into test classes
Will help get rid of errors like the following: ``` 1) Error: JDOMEngineTest#test_order=: ArgumentError: wrong number of arguments (0 for 1) /Users/jon/code/rails/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb:106:in `test_order=' ```
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/test/xml_mini/jdom_engine_test.rb20
-rw-r--r--activesupport/test/xml_mini/libxml_engine_test.rb20
-rw-r--r--activesupport/test/xml_mini/libxmlsax_engine_test.rb20
3 files changed, 27 insertions, 33 deletions
diff --git a/activesupport/test/xml_mini/jdom_engine_test.rb b/activesupport/test/xml_mini/jdom_engine_test.rb
index 816d57972c..66b15aed4a 100644
--- a/activesupport/test/xml_mini/jdom_engine_test.rb
+++ b/activesupport/test/xml_mini/jdom_engine_test.rb
@@ -4,17 +4,15 @@ if RUBY_PLATFORM.include?("java")
require "active_support/core_ext/hash/conversions"
class JDOMEngineTest < ActiveSupport::TestCase
- include ActiveSupport
-
FILES_DIR = File.dirname(__FILE__) + "/../fixtures/xml"
def setup
- @default_backend = XmlMini.backend
- XmlMini.backend = "JDOM"
+ @default_backend = ActiveSupport::XmlMini.backend
+ ActiveSupport::XmlMini.backend = "JDOM"
end
def teardown
- XmlMini.backend = @default_backend
+ ActiveSupport::XmlMini.backend = @default_backend
end
def test_file_from_xml
@@ -84,13 +82,13 @@ if RUBY_PLATFORM.include?("java")
end
def test_setting_JDOM_as_backend
- XmlMini.backend = "JDOM"
- assert_equal XmlMini_JDOM, XmlMini.backend
+ ActiveSupport::XmlMini.backend = "JDOM"
+ assert_equal ActiveSupport::XmlMini_JDOM, ActiveSupport::XmlMini.backend
end
def test_blank_returns_empty_hash
- assert_equal({}, XmlMini.parse(nil))
- assert_equal({}, XmlMini.parse(""))
+ assert_equal({}, ActiveSupport::XmlMini.parse(nil))
+ assert_equal({}, ActiveSupport::XmlMini.parse(""))
end
def test_array_type_makes_an_array
@@ -175,8 +173,8 @@ if RUBY_PLATFORM.include?("java")
private
def assert_equal_rexml(xml)
- parsed_xml = XmlMini.parse(xml)
- hash = XmlMini.with_backend("REXML") { XmlMini.parse(xml) }
+ parsed_xml = ActiveSupport::XmlMini.parse(xml)
+ hash = ActiveSupport::XmlMini.with_backend("REXML") { ActiveSupport::XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end
diff --git a/activesupport/test/xml_mini/libxml_engine_test.rb b/activesupport/test/xml_mini/libxml_engine_test.rb
index 81b0d3c407..ae3a5562e0 100644
--- a/activesupport/test/xml_mini/libxml_engine_test.rb
+++ b/activesupport/test/xml_mini/libxml_engine_test.rb
@@ -8,17 +8,15 @@ else
require "active_support/core_ext/hash/conversions"
class LibxmlEngineTest < ActiveSupport::TestCase
- include ActiveSupport
-
def setup
- @default_backend = XmlMini.backend
- XmlMini.backend = "LibXML"
+ @default_backend = ActiveSupport::XmlMini.backend
+ ActiveSupport::XmlMini.backend = "LibXML"
LibXML::XML::Error.set_handler(&lambda { |error| }) #silence libxml, exceptions will do
end
def teardown
- XmlMini.backend = @default_backend
+ ActiveSupport::XmlMini.backend = @default_backend
end
def test_exception_thrown_on_expansion_attack
@@ -42,13 +40,13 @@ else
end
def test_setting_libxml_as_backend
- XmlMini.backend = "LibXML"
- assert_equal XmlMini_LibXML, XmlMini.backend
+ ActiveSupport::XmlMini.backend = "LibXML"
+ assert_equal ActiveSupport::XmlMini_LibXML, ActiveSupport::XmlMini.backend
end
def test_blank_returns_empty_hash
- assert_equal({}, XmlMini.parse(nil))
- assert_equal({}, XmlMini.parse(""))
+ assert_equal({}, ActiveSupport::XmlMini.parse(nil))
+ assert_equal({}, ActiveSupport::XmlMini.parse(""))
end
def test_array_type_makes_an_array
@@ -193,9 +191,9 @@ else
private
def assert_equal_rexml(xml)
- parsed_xml = XmlMini.parse(xml)
+ parsed_xml = ActiveSupport::XmlMini.parse(xml)
xml.rewind if xml.respond_to?(:rewind)
- hash = XmlMini.with_backend("REXML") { XmlMini.parse(xml) }
+ hash = ActiveSupport::XmlMini.with_backend("REXML") { ActiveSupport::XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end
diff --git a/activesupport/test/xml_mini/libxmlsax_engine_test.rb b/activesupport/test/xml_mini/libxmlsax_engine_test.rb
index e25fa2813c..f52afd273e 100644
--- a/activesupport/test/xml_mini/libxmlsax_engine_test.rb
+++ b/activesupport/test/xml_mini/libxmlsax_engine_test.rb
@@ -8,15 +8,13 @@ else
require "active_support/core_ext/hash/conversions"
class LibXMLSAXEngineTest < ActiveSupport::TestCase
- include ActiveSupport
-
def setup
- @default_backend = XmlMini.backend
- XmlMini.backend = "LibXMLSAX"
+ @default_backend = ActiveSupport::XmlMini.backend
+ ActiveSupport::XmlMini.backend = "LibXMLSAX"
end
def teardown
- XmlMini.backend = @default_backend
+ ActiveSupport::XmlMini.backend = @default_backend
end
def test_exception_thrown_on_expansion_attack
@@ -42,13 +40,13 @@ else
end
def test_setting_libxml_as_backend
- XmlMini.backend = "LibXMLSAX"
- assert_equal XmlMini_LibXMLSAX, XmlMini.backend
+ ActiveSupport::XmlMini.backend = "LibXMLSAX"
+ assert_equal ActiveSupport::XmlMini_LibXMLSAX, ActiveSupport::XmlMini.backend
end
def test_blank_returns_empty_hash
- assert_equal({}, XmlMini.parse(nil))
- assert_equal({}, XmlMini.parse(""))
+ assert_equal({}, ActiveSupport::XmlMini.parse(nil))
+ assert_equal({}, ActiveSupport::XmlMini.parse(""))
end
def test_array_type_makes_an_array
@@ -185,9 +183,9 @@ else
private
def assert_equal_rexml(xml)
- parsed_xml = XmlMini.parse(xml)
+ parsed_xml = ActiveSupport::XmlMini.parse(xml)
xml.rewind if xml.respond_to?(:rewind)
- hash = XmlMini.with_backend("REXML") { XmlMini.parse(xml) }
+ hash = ActiveSupport::XmlMini.with_backend("REXML") { ActiveSupport::XmlMini.parse(xml) }
assert_equal(hash, parsed_xml)
end
end