Class: TestSpecialMarkup
- Inherits:
-
Builder::Test
show all
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb
Constant Summary
Minitest::Test::PASSTHROUGH_EXCEPTIONS, Minitest::Test::SETUP_METHODS, Minitest::Test::TEARDOWN_METHODS
Minitest::Assertions::E, Minitest::Assertions::UNDEFINED
Minitest::Runnable::SIGNALS
Instance Attribute Summary
#assertions, #failures, #time
Instance Method Summary
collapse
#assert_nothing_raised
#capture_exceptions, #class_name, #clean, i_suck_and_my_tests_are_order_dependent!, make_my_diffs_pretty!, #neuter_exception, #new_exception, parallelize_me!, #run, runnable_methods, #sanitize_exception, test_order, #with_empty_backtrace_filter, #with_info_handler
#jruby?, #maglev?, #mri?, #osx?, #rubinius?, #windows?
#after_setup, #after_teardown, #before_setup, #before_teardown, #teardown
#class_name, #error?, #location, #passed?, #result_code, #skipped?
#_synchronize, #assert, #assert_empty, #assert_equal, #assert_in_delta, #assert_in_epsilon, #assert_includes, #assert_instance_of, #assert_kind_of, #assert_match, #assert_mock, #assert_nil, #assert_operator, #assert_output, #assert_path_exists, #assert_predicate, #assert_raises, #assert_respond_to, #assert_same, #assert_send, #assert_silent, #assert_throws, #capture_io, #capture_subprocess_io, #diff, diff, diff=, #exception_details, #fail_after, #flunk, #message, #mu_pp, #mu_pp_for_diff, #pass, #refute, #refute_empty, #refute_equal, #refute_in_delta, #refute_in_epsilon, #refute_includes, #refute_instance_of, #refute_kind_of, #refute_match, #refute_nil, #refute_operator, #refute_path_exists, #refute_predicate, #refute_respond_to, #refute_same, #skip, #skip_until, #skipped?, #things_to_diff
#failure, inherited, #initialize, #marshal_dump, #marshal_load, methods_matching, #name, #name=, on_signal, #passed?, reset, #result_code, run, #run, run_one_method, runnable_methods, runnables, #skipped?, #time_it, #whatever, with_info_handler
Instance Method Details
362
363
364
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 362
def setup
@xml = Builder::XmlMarkup.new(:indent=>2)
end
|
#test_cdata ⇒ Object
416
417
418
419
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 416
def test_cdata
@xml.cdata!("TEST")
assert_equal "<![CDATA[TEST]]>\n", @xml.target!
end
|
#test_cdata_value ⇒ Object
421
422
423
424
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 421
def test_cdata_value
@xml.cdata_value!("content:encoded", "<p>TEST</p>")
assert_equal "<content:encoded><![CDATA[<p>TEST</p>]]></content:encoded>\n", @xml.target!
end
|
#test_cdata_with_ampersand ⇒ Object
426
427
428
429
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 426
def test_cdata_with_ampersand
@xml.cdata!("TEST&CHECK")
assert_equal "<![CDATA[TEST&CHECK]]>\n", @xml.target!
end
|
#test_cdata_with_included_close ⇒ Object
431
432
433
434
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 431
def test_cdata_with_included_close
@xml.cdata!("TEST]]>CHECK")
assert_equal "<![CDATA[TEST]]]]><![CDATA[>CHECK]]>\n", @xml.target!
end
|
366
367
368
369
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 366
def
@xml.("COMMENT")
assert_equal "<!-- COMMENT -->\n", @xml.target!
end
|
371
372
373
374
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 371
def
@xml.p { @xml. "OK" }
assert_equal "<p>\n <!-- OK -->\n</p>\n", @xml.target!
end
|
#test_indented_instruct ⇒ Object
381
382
383
384
385
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 381
def test_indented_instruct
@xml.p { @xml.instruct! :xml }
assert_match %r{<p>\n <\?xml version="1.0" encoding="UTF-8"\?>\n</p>\n},
@xml.target!
end
|
#test_instruct ⇒ Object
376
377
378
379
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 376
def test_instruct
@xml.instruct! :abc, :version=>"0.9"
assert_equal "<?abc version=\"0.9\"?>\n", @xml.target!
end
|
#test_instruct_without_attributes ⇒ Object
387
388
389
390
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 387
def test_instruct_without_attributes
@xml.instruct! :zz
assert_equal "<?zz?>\n", @xml.target!
end
|
#test_no_blocks ⇒ Object
407
408
409
410
411
412
413
414
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 407
def test_no_blocks
assert_raise(Builder::IllegalBlockError) do
@xml.instruct! { |x| x.hi }
end
assert_raise(Builder::IllegalBlockError) do
@xml.(:element) { |x| x.hi }
end
end
|
#test_xml_instruct ⇒ Object
392
393
394
395
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 392
def test_xml_instruct
@xml.instruct!
assert_match(/^<\?xml version="1.0" encoding="UTF-8"\?>$/, @xml.target!)
end
|
#test_xml_instruct_with_overrides ⇒ Object
397
398
399
400
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 397
def test_xml_instruct_with_overrides
@xml.instruct! :xml, :encoding=>"UCS-2"
assert_match(/^<\?xml version="1.0" encoding="UCS-2"\?>$/, @xml.target!)
end
|
#test_xml_instruct_with_standalong ⇒ Object
402
403
404
405
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 402
def test_xml_instruct_with_standalong
@xml.instruct! :xml, :encoding=>"UCS-2", :standalone=>"yes"
assert_match(/^<\?xml version="1.0" encoding="UCS-2" standalone="yes"\?>$/, @xml.target!)
end
|