Class: TestNameSpaces

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

Constants inherited from Minitest::Test

Minitest::Test::PASSTHROUGH_EXCEPTIONS, Minitest::Test::SETUP_METHODS, Minitest::Test::TEARDOWN_METHODS

Constants included from Minitest::Assertions

Minitest::Assertions::E, Minitest::Assertions::UNDEFINED

Constants inherited from Minitest::Runnable

Minitest::Runnable::SIGNALS

Instance Attribute Summary

Attributes inherited from Minitest::Runnable

#assertions, #failures, #time

Instance Method Summary collapse

Methods inherited from Builder::Test

#assert_nothing_raised

Methods inherited from Minitest::Test

#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

Methods included from Minitest::Guard

#jruby?, #maglev?, #mri?, #osx?, #rubinius?, #windows?

Methods included from Minitest::Test::LifecycleHooks

#after_setup, #after_teardown, #before_setup, #before_teardown, #teardown

Methods included from Minitest::Reportable

#class_name, #error?, #location, #passed?, #result_code, #skipped?

Methods included from Minitest::Assertions

#_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

Methods inherited from Minitest::Runnable

#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

Constructor Details

This class inherits a constructor from Minitest::Runnable

Instance Method Details

#setupObject



253
254
255
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 253

def setup
  @xml = Builder::XmlMarkup.new(:indent=>2)
end

#test_ensureObject



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 286

def test_ensure
  xml = Builder::XmlMarkup.new
  xml.html do
    xml.body do
     begin
       xml.p do
         raise Exception.new('boom')
       end
     rescue Exception => e
       xml.pre e
     end
    end
  end
  assert_match %r{<p>},  xml.target!
  assert_match %r{</p>}, xml.target!
end

#test_longObject



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 262

def test_long
  xml = Builder::XmlMarkup.new(:indent=>2)
  xml.instruct!
  xml.rdf :RDF,
    "xmlns:rdf" => :"&rdf;",
    "xmlns:rdfs" => :"&rdfs;",
    "xmlns:xsd" => :"&xsd;",
    "xmlns:owl" => :"&owl;" do
    xml.owl :Class, :'rdf:ID'=>'Bird' do
	xml.rdfs :label, 'bird'
	xml.rdfs :subClassOf do
 xml.owl :Restriction do
   xml.owl :onProperty, 'rdf:resource'=>'#wingspan'
   xml.owl :maxCardinality,1,'rdf:datatype'=>'&xsd;nonNegativeInteger'
 end
	end
    end
  end
  assert_match(/^<\?xml/, xml.target!)
  assert_match(/\n<rdf:RDF/m, xml.target!)
  assert_match(/xmlns:rdf="&rdf;"/m, xml.target!)
  assert_match(/<owl:Restriction>/m, xml.target!)
end

#test_simple_name_spacesObject



257
258
259
260
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/builder-3.2.4/test/test_markupbuilder.rb', line 257

def test_simple_name_spaces
  @xml.rdf :RDF
  assert_equal "<rdf:RDF/>\n", @xml.target!
end