aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/xml_mini_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-07-26 10:58:16 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-07-26 11:00:33 -0700
commitd4246e5bb3a446238f2b0683f24638bad669778f (patch)
treebd7ce40a3466868ea45d22dd84fbd62808c38b12 /activesupport/test/xml_mini_test.rb
parentaf6abc6404561770f7109fa4cd62c48e81c33651 (diff)
downloadrails-d4246e5bb3a446238f2b0683f24638bad669778f.tar.gz
rails-d4246e5bb3a446238f2b0683f24638bad669778f.tar.bz2
rails-d4246e5bb3a446238f2b0683f24638bad669778f.zip
fixing whitespace errors
Diffstat (limited to 'activesupport/test/xml_mini_test.rb')
-rw-r--r--activesupport/test/xml_mini_test.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/activesupport/test/xml_mini_test.rb b/activesupport/test/xml_mini_test.rb
index e2b90ae16e..4450c1a0ae 100644
--- a/activesupport/test/xml_mini_test.rb
+++ b/activesupport/test/xml_mini_test.rb
@@ -50,49 +50,49 @@ module XmlMiniTest
def test_rename_key_does_not_dasherize_multiple_trailing_underscores
assert_equal "id__", ActiveSupport::XmlMini.rename_key("id__")
- end
+ end
end
class ToTagTest < ActiveSupport::TestCase
def assert_xml(xml)
assert_equal xml, @options[:builder].target!
end
-
+
setup do
@xml = ActiveSupport::XmlMini
@options = {:skip_instruct => true, :builder => Builder::XmlMarkup.new}
end
-
+
test "#to_tag accepts a callable object and passes options with the builder" do
@xml.to_tag(:some_tag, lambda {|o| o[:builder].br }, @options)
assert_xml "<br/>"
end
-
+
test "#to_tag accepts a callable object and passes options and tag name" do
@xml.to_tag(:tag, lambda {|o, t| o[:builder].b(t) }, @options)
assert_xml "<b>tag</b>"
end
-
+
test "#to_tag accepts an object responding to #to_xml and passes the options, where :root is key" do
obj = Object.new
obj.instance_eval do
def to_xml(options) options[:builder].yo(options[:root].to_s) end
end
-
+
@xml.to_tag(:tag, obj, @options)
assert_xml "<yo>tag</yo>"
end
-
+
test "#to_tag accepts arbitrary objects responding to #to_str" do
@xml.to_tag(:b, "Howdy", @options)
assert_xml "<b>Howdy</b>"
end
-
+
test "#to_tag should dasherize the space when passed a string with spaces as a key" do
@xml.to_tag("New York", 33, @options)
assert_xml "<New---York type=\"integer\">33</New---York>"
end
-
+
test "#to_tag should dasherize the space when passed a symbol with spaces as a key" do
@xml.to_tag(:"New York", 33, @options)
assert_xml "<New---York type=\"integer\">33</New---York>"