From 3a47cf3395dd4c4fe8bdd5df13aab698f2ca314b Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 15 May 2011 11:55:52 +0000 Subject: * remove trailing spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/dl/test_func.rb | 2 +- test/json/test_json.rb | 2 +- test/json/test_json_addition.rb | 2 +- test/logger/test_logger.rb | 2 +- test/minitest/test_minitest_mock.rb | 4 +- test/open-uri/test_ssl.rb | 18 ++-- test/openssl/test_asn1.rb | 4 +- test/openssl/test_x509cert.rb | 4 +- test/openssl/test_x509crl.rb | 4 +- test/openssl/test_x509req.rb | 4 +- test/psych/test_null.rb | 2 +- test/psych/test_struct.rb | 2 +- test/rake/in_environment.rb | 4 +- test/rake/test_application.rb | 30 +++--- test/rake/test_definitions.rb | 4 +- test/rake/test_earlytime.rb | 2 +- test/rake/test_extension.rb | 4 +- test/rake/test_file_task.rb | 2 +- test/rake/test_filelist.rb | 22 ++--- test/rake/test_fileutils.rb | 10 +- test/rake/test_multitask.rb | 2 +- test/rake/test_pathmap.rb | 2 +- test/rake/test_rake.rb | 2 +- test/rake/test_task_arguments.rb | 2 +- test/rake/test_task_manager.rb | 4 +- test/rake/test_test_task.rb | 2 +- test/rdoc/test_rdoc_context_section.rb | 2 +- test/rdoc/test_rdoc_parser_ruby.rb | 2 +- test/readline/test_readline.rb | 6 +- test/rexml/test_attributes.rb | 4 +- test/rexml/test_contrib.rb | 18 ++-- test/rexml/test_doctype.rb | 14 +-- test/rexml/test_elements.rb | 12 +-- test/rexml/test_encoding_2.rb | 2 +- test/rexml/test_entity.rb | 10 +- test/rexml/test_functions.rb | 2 +- test/rexml/test_jaxen.rb | 46 +++++----- test/rexml/test_light.rb | 4 +- test/rexml/test_listener.rb | 6 +- test/rexml/test_notationdecl_mixin.rb | 6 +- test/rexml/test_notationdecl_parsetest.rb | 2 +- test/rexml/test_pullparser.rb | 10 +- test/rexml/test_sax.rb | 14 +-- test/rexml/test_stream.rb | 8 +- test/rexml/test_validation_rng.rb | 6 +- test/rexml/test_xml_declaration_parent_child.rb | 6 +- test/rexml/test_xpath.rb | 106 +++++++++++----------- test/rexml/test_xpath_attribute_query.rb | 28 +++--- test/rexml/test_xpath_pred.rb | 6 +- test/ruby/test_marshal.rb | 2 +- test/ruby/test_module.rb | 2 +- test/ruby/test_super.rb | 2 +- test/ruby/test_time.rb | 2 +- test/rubygems/test_gem_commands_unpack_command.rb | 14 +-- test/rubygems/test_gem_platform.rb | 8 +- test/rubygems/test_gem_silent_ui.rb | 4 +- test/syck/test_null.rb | 2 +- test/syck/test_struct.rb | 2 +- test/syck/test_yaml.rb | 4 +- test/test_pstore.rb | 2 +- test/thread/test_queue.rb | 2 +- test/webrick/test_cookie.rb | 2 +- test/webrick/test_httprequest.rb | 4 +- test/win32ole/test_win32ole_variant.rb | 2 +- 64 files changed, 258 insertions(+), 258 deletions(-) (limited to 'test') diff --git a/test/dl/test_func.rb b/test/dl/test_func.rb index 27bf7daf7f..45d475c919 100644 --- a/test/dl/test_func.rb +++ b/test/dl/test_func.rb @@ -58,7 +58,7 @@ module DL assert_equal("123", str.to_s) ensure GC.stress = stress - end + end def test_isdigit() f = Function.new(CFunc.new(@libc['isdigit'], TYPE_INT, 'isdigit'), diff --git a/test/json/test_json.rb b/test/json/test_json.rb index aea50485fc..4c724fd36e 100755 --- a/test/json/test_json.rb +++ b/test/json/test_json.rb @@ -154,7 +154,7 @@ class TC_JSON < Test::Unit::TestCase assert_equal(@ary, parse('[[1],["foo"],[3.14],[47.11e+2],[2718.0E-3],[null],[[1,-2,3]]'\ ',[false],[true]]')) - assert_equal(@ary, parse(%Q{ [ [1] , ["foo"] , [3.14] \t , [47.11e+2] + assert_equal(@ary, parse(%Q{ [ [1] , ["foo"] , [3.14] \t , [47.11e+2] , [2718.0E-3 ],\r[ null] , [[1, -2, 3 ]], [false ],[ true]\n ] })) end diff --git a/test/json/test_json_addition.rb b/test/json/test_json_addition.rb index 34f0a71b48..36b89e5c35 100755 --- a/test/json/test_json_addition.rb +++ b/test/json/test_json_addition.rb @@ -23,7 +23,7 @@ class TC_JSONAddition < Test::Unit::TestCase def ==(other) a == other.a end - + def self.json_create(object) new(*object['args']) end diff --git a/test/logger/test_logger.rb b/test/logger/test_logger.rb index 576bec519f..0736314b1a 100644 --- a/test/logger/test_logger.rb +++ b/test/logger/test_logger.rb @@ -498,7 +498,7 @@ class TestLoggerApplication < Test::Unit::TestCase @app.set_log(@filename) begin @app.level = Logger::UNKNOWN - @app.start # logs FATAL log + @app.start # logs FATAL log assert_equal(1, File.read(@filename).split(/\n/).size) ensure @app.logger.close diff --git a/test/minitest/test_minitest_mock.rb b/test/minitest/test_minitest_mock.rb index 311f5fa7fb..5d0bae8ad7 100644 --- a/test/minitest/test_minitest_mock.rb +++ b/test/minitest/test_minitest_mock.rb @@ -89,10 +89,10 @@ class TestMiniTestMock < MiniTest::Unit::TestCase def test_assign_per_mock_return_values a = MiniTest::Mock.new b = MiniTest::Mock.new - + a.expect(:foo, :a) b.expect(:foo, :b) - + assert_equal :a, a.foo assert_equal :b, b.foo end diff --git a/test/open-uri/test_ssl.rb b/test/open-uri/test_ssl.rb index 0502f76346..64fc214ce5 100644 --- a/test/open-uri/test_ssl.rb +++ b/test/open-uri/test_ssl.rb @@ -143,13 +143,13 @@ Certificate: 36:c1:44:4e:ab:9a:b2:73:6d Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:FALSE - Netscape Comment: + Netscape Comment: OpenSSL Generated Certificate - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 24:6F:03:A3:EE:06:51:75:B2:BA:FC:3A:38:59:BF:ED:87:CD:E8:7F - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:24:6F:03:A3:EE:06:51:75:B2:BA:FC:3A:38:59:BF:ED:87:CD:E8:7F Signature Algorithm: sha1WithRSAEncryption @@ -205,15 +205,15 @@ Certificate: f0:86:61:ce:f1:ff:42:c7:23 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:FALSE - Netscape Cert Type: + Netscape Cert Type: SSL Server - Netscape Comment: + Netscape Comment: OpenSSL Generated Certificate - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 7F:17:5A:58:88:96:E1:1F:44:EA:FF:AD:C6:2E:90:E2:95:32:DD:F0 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:24:6F:03:A3:EE:06:51:75:B2:BA:FC:3A:38:59:BF:ED:87:CD:E8:7F Signature Algorithm: sha1WithRSAEncryption diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb index 4fd4771d7b..62d0eb476d 100644 --- a/test/openssl/test_asn1.rb +++ b/test/openssl/test_asn1.rb @@ -429,7 +429,7 @@ class OpenSSL::TestASN1 < Test::Unit::TestCase assert_equal(raw, OpenSSL::ASN1.decode(raw).to_der) end end - + def test_primitive_inf_length assert_raises(OpenSSL::ASN1::ASN1Error) do spec = %w{ 02 80 02 01 01 00 00 } @@ -438,6 +438,6 @@ class OpenSSL::TestASN1 < Test::Unit::TestCase OpenSSL::ASN1.decode_all(raw) end end - + end if defined?(OpenSSL) diff --git a/test/openssl/test_x509cert.rb b/test/openssl/test_x509cert.rb index 786eebb368..6d39c9690d 100644 --- a/test/openssl/test_x509cert.rb +++ b/test/openssl/test_x509cert.rb @@ -170,9 +170,9 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase nil, nil, OpenSSL::Digest::MD5.new) } end - + private - + def certificate_error_returns_false yield rescue OpenSSL::X509::CertificateError diff --git a/test/openssl/test_x509crl.rb b/test/openssl/test_x509crl.rb index c0c996e966..56508e0a12 100644 --- a/test/openssl/test_x509crl.rb +++ b/test/openssl/test_x509crl.rb @@ -208,9 +208,9 @@ class OpenSSL::TestX509CRL < Test::Unit::TestCase crl.version = 0 assert_equal(false, crl.verify(@dsa512)) end - + private - + def crl_error_returns_false yield rescue OpenSSL::X509::CRLError diff --git a/test/openssl/test_x509req.rb b/test/openssl/test_x509req.rb index 1b660ca051..882a1d7356 100644 --- a/test/openssl/test_x509req.rb +++ b/test/openssl/test_x509req.rb @@ -137,9 +137,9 @@ class OpenSSL::TestX509Request < Test::Unit::TestCase assert_raise(OpenSSL::X509::RequestError){ issue_csr(0, @dn, @dsa512, OpenSSL::Digest::MD5.new) } end - + private - + def request_error_returns_false yield rescue OpenSSL::X509::RequestError diff --git a/test/psych/test_null.rb b/test/psych/test_null.rb index 1ebf6444c2..0fee1d2464 100644 --- a/test/psych/test_null.rb +++ b/test/psych/test_null.rb @@ -10,7 +10,7 @@ module Psych --- - ~ - null -- +- - Null - NULL eoyml diff --git a/test/psych/test_struct.rb b/test/psych/test_struct.rb index 42c4e113ab..39e38f7dfd 100644 --- a/test/psych/test_struct.rb +++ b/test/psych/test_struct.rb @@ -39,7 +39,7 @@ module Psych def test_load obj = Psych.load(<<-eoyml) ---- !ruby/struct:PsychStructWithIvar +--- !ruby/struct:PsychStructWithIvar :foo: bar :@bar: hello eoyml diff --git a/test/rake/in_environment.rb b/test/rake/in_environment.rb index f0a340fac9..f6fd8fb731 100644 --- a/test/rake/in_environment.rb +++ b/test/rake/in_environment.rb @@ -1,11 +1,11 @@ module InEnvironment private - + # Create an environment for a test. At the completion of the yielded # block, the environment is restored to its original conditions. def in_environment(settings) original_settings = set_env(settings) - yield + yield ensure set_env(original_settings) if original_settings end diff --git a/test/rake/test_application.rb b/test/rake/test_application.rb index 9158689e65..27c7d8df05 100644 --- a/test/rake/test_application.rb +++ b/test/rake/test_application.rb @@ -123,7 +123,7 @@ class Rake::TestApplication < Test::Unit::TestCase def test_load_rakefile in_environment("PWD" => File.join(BASEDIR, "data/unittest")) do - @app.instance_eval do + @app.instance_eval do handle_options options.silent = true load_rakefile @@ -151,8 +151,8 @@ class Rake::TestApplication < Test::Unit::TestCase handle_options options.silent = true end - ex = assert_raise(RuntimeError) do - @app.instance_eval do raw_load_rakefile end + ex = assert_raise(RuntimeError) do + @app.instance_eval do raw_load_rakefile end end assert_match(/no rakefile found/i, ex.message) end @@ -313,7 +313,7 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase RakeFileUtils.verbose_flag = false RakeFileUtils.nowrite_flag = false end - + def clear_argv while ! ARGV.empty? ARGV.pop @@ -519,7 +519,7 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase assert_equal :exit, @exit end end - + def test_classic_namespace flags(['--classic-namespace'], ['-C', '-T', '-P', '-n', '-s', '-t']) do |opts| assert opts.classic_namespace @@ -534,7 +534,7 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase def test_bad_option capture_stderr do ex = assert_raise(OptionParser::InvalidOption) do - flags('--bad-option') + flags('--bad-option') end if ex.message =~ /^While/ # Ruby 1.9 error message assert_match(/while parsing/i, ex.message) @@ -549,12 +549,12 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase command_line("a", "b") assert_equal ["a", "b"], @tasks.sort end - + def test_default_task_collection command_line() assert_equal ["default"], @tasks end - + def test_environment_definition ENV.delete('TESTKEY') command_line("a", "TESTKEY=12") @@ -562,12 +562,12 @@ class Rake::TestApplicationOptions < Test::Unit::TestCase assert '12', ENV['TESTKEY'] end - private + private def flags(*sets) sets.each do |set| ARGV.clear - @out = capture_stdout { + @out = capture_stdout { @exit = catch(:system_exit) { opts = command_line(*set) } } yield(@app.options) if block_given? @@ -593,31 +593,31 @@ class Rake::TestTaskArgumentParsing < Test::Unit::TestCase def setup @app = Rake::Application.new end - + def test_name_only name, args = @app.parse_task_string("name") assert_equal "name", name assert_equal [], args end - + def test_empty_args name, args = @app.parse_task_string("name[]") assert_equal "name", name assert_equal [], args end - + def test_one_argument name, args = @app.parse_task_string("name[one]") assert_equal "name", name assert_equal ["one"], args end - + def test_two_arguments name, args = @app.parse_task_string("name[one,two]") assert_equal "name", name assert_equal ["one", "two"], args end - + def test_can_handle_spaces_between_args name, args = @app.parse_task_string("name[one, two,\tthree , \tfour]") assert_equal "name", name diff --git a/test/rake/test_definitions.rb b/test/rake/test_definitions.rb index 164958ecd5..a5440dcadc 100644 --- a/test/rake/test_definitions.rb +++ b/test/rake/test_definitions.rb @@ -6,7 +6,7 @@ require_relative 'filecreation' ###################################################################### class Rake::TestDefinitions < Test::Unit::TestCase include Rake - + EXISTINGFILE = "testdata/existing" def setup @@ -78,4 +78,4 @@ class Rake::TestDefinitions < Test::Unit::TestCase end end - + diff --git a/test/rake/test_earlytime.rb b/test/rake/test_earlytime.rb index a228146679..d94523cffd 100644 --- a/test/rake/test_earlytime.rb +++ b/test/rake/test_earlytime.rb @@ -24,7 +24,7 @@ class Rake::TestEarlyTime < Test::Unit::TestCase assert t1 < t2 assert t2 > t1 assert t1 == t1 - assert t2 == t2 + assert t2 == t2 end def test_to_s diff --git a/test/rake/test_extension.rb b/test/rake/test_extension.rb index 94348aafa6..3b10a4c6ed 100644 --- a/test/rake/test_extension.rb +++ b/test/rake/test_extension.rb @@ -16,14 +16,14 @@ class Rake::TestExtension < Test::Unit::TestCase $stderr = old_err end end - + class Sample extend Redirect def duplicate_method :original end - + OK_ERRS = error_redirect do rake_extension("a") do def ok_method diff --git a/test/rake/test_file_task.rb b/test/rake/test_file_task.rb index 0232ac95ed..132bd88853 100644 --- a/test/rake/test_file_task.rb +++ b/test/rake/test_file_task.rb @@ -77,7 +77,7 @@ class Rake::TestFileTask < Test::Unit::TestCase # deleting the file target on failure is always the proper thing to # do. I'm willing to hear input on this topic. def ztest_file_deletes_on_failure - task :obj + task :obj file NEWFILE => [:obj] do |t| FileUtils.touch NEWFILE fail "Ooops" diff --git a/test/rake/test_filelist.rb b/test/rake/test_filelist.rb index 08456a4da8..2b1ad44237 100644 --- a/test/rake/test_filelist.rb +++ b/test/rake/test_filelist.rb @@ -89,7 +89,7 @@ class Rake::TestFileList < Test::Unit::TestCase h = f.include("y") assert_equal f.object_id, h.object_id end - + def test_match fl = FileList.new fl.include(File.expand_path('../test*.rb', __FILE__)) @@ -155,7 +155,7 @@ class Rake::TestFileList < Test::Unit::TestCase fl.exclude('testdata/existing') assert_equal [], fl end - + def test_excluding_via_block fl = FileList['testdata/a.c', 'testdata/b.c', 'testdata/xyz.c'] fl.exclude { |fn| fn.pathmap('%n') == 'xyz' } @@ -235,24 +235,24 @@ class Rake::TestFileList < Test::Unit::TestCase assert_equal ["testdata/abc.o", "testdata/x.o", "testdata/xyz.o"].sort, f3.sort end - + def test_claim_to_be_a_kind_of_array fl = FileList['testdata/*.c'] assert fl.is_a?(Array) assert fl.kind_of?(Array) end - + def test_claim_to_be_a_kind_of_filelist fl = FileList['testdata/*.c'] assert fl.is_a?(FileList) assert fl.kind_of?(FileList) end - + def test_claim_to_be_a_filelist_instance fl = FileList['testdata/*.c'] assert fl.instance_of?(FileList) end - + def test_dont_claim_to_be_an_array_instance fl = FileList['testdata/*.c'] assert ! fl.instance_of?(Array) @@ -590,12 +590,12 @@ class Rake::TestFileList < Test::Unit::TestCase assert_equal ['b', 'd'], r assert_equal FileList, r.class end - + def test_file_utils_can_use_filelists cfiles = FileList['testdata/*.c'] - + cp cfiles, @cdir, :verbose => false - + assert File.exist?(File.join(@cdir, 'abc.c')) assert File.exist?(File.join(@cdir, 'xyz.c')) assert File.exist?(File.join(@cdir, 'x.c')) @@ -603,7 +603,7 @@ class Rake::TestFileList < Test::Unit::TestCase def create_test_data verbose(false) do - + mkdir "testdata" unless File.exist? "testdata" mkdir "testdata/CVS" rescue nil mkdir "testdata/.svn" rescue nil @@ -621,5 +621,5 @@ class Rake::TestFileList < Test::Unit::TestCase touch "testdata/existing" end end - + end diff --git a/test/rake/test_fileutils.rb b/test/rake/test_fileutils.rb index 1664ec80c3..b6106c0978 100644 --- a/test/rake/test_fileutils.rb +++ b/test/rake/test_fileutils.rb @@ -18,7 +18,7 @@ class Rake::TestFileUtils < Test::Unit::TestCase @oldruby = nil end end - + def teardown FileUtils.rm_rf("testdata") FileUtils::LN_SUPPORTED[0] = true @@ -28,7 +28,7 @@ class Rake::TestFileUtils < Test::Unit::TestCase FileUtils.class_eval {const_set(:RUBY, ruby)} end end - + def test_rm_one_file create_file("testdata/a") FileUtils.rm_rf "testdata/a" @@ -165,7 +165,7 @@ class Rake::TestFileUtils < Test::Unit::TestCase end def test_sh_failure - assert_raise(RuntimeError) { + assert_raise(RuntimeError) { verbose(false) { Sh.run "#{RUBY} #{File.expand_path('../shellcommand.rb', __FILE__)} 1" } } end @@ -241,7 +241,7 @@ class Rake::TestFileUtils < Test::Unit::TestCase end private - + def redirect_stderr old_err = $stderr $stderr = StringIO.new @@ -258,5 +258,5 @@ class Rake::TestFileUtils < Test::Unit::TestCase def env_var windows? ? '%RAKE_TEST_SH%' : '$RAKE_TEST_SH' end - + end diff --git a/test/rake/test_multitask.rb b/test/rake/test_multitask.rb index 9711e7e77e..0413d03db3 100644 --- a/test/rake/test_multitask.rb +++ b/test/rake/test_multitask.rb @@ -40,4 +40,4 @@ class Rake::TestMultiTask < Test::Unit::TestCase end end - + diff --git a/test/rake/test_pathmap.rb b/test/rake/test_pathmap.rb index 257529ab87..2775b91039 100644 --- a/test/rake/test_pathmap.rb +++ b/test/rake/test_pathmap.rb @@ -23,7 +23,7 @@ class Rake::TestPathMap < Test::Unit::TestCase def test_n_returns_basename_without_extension assert_equal "abc", "abc.rb".pathmap("%n") - assert_equal "abc", "abc".pathmap("%n") + assert_equal "abc", "abc".pathmap("%n") assert_equal "abc", "this/is/a/dir/abc.rb".pathmap("%n") assert_equal "abc", "/this/is/a/dir/abc.rb".pathmap("%n") assert_equal "abc", "/this/is/a/dir/abc".pathmap("%n") diff --git a/test/rake/test_rake.rb b/test/rake/test_rake.rb index 52230fe148..44fecee559 100644 --- a/test/rake/test_rake.rb +++ b/test/rake/test_rake.rb @@ -35,5 +35,5 @@ class Rake::TestRake < Test::Unit::TestCase def test_original_dir_reports_current_dir assert_equal Dir.pwd, Rake.original_dir end - + end diff --git a/test/rake/test_task_arguments.rb b/test/rake/test_task_arguments.rb index d40144f3fd..9e907aed7d 100644 --- a/test/rake/test_task_arguments.rb +++ b/test/rake/test_task_arguments.rb @@ -76,7 +76,7 @@ class Rake::TestTaskArguments < Test::Unit::TestCase child = Rake::TaskArguments.new(['aa'], [2], parent) assert_equal 2, child.aa end - + def test_default_arguments_values_can_be_merged ta = Rake::TaskArguments.new(["aa", "bb"], [nil, "original_val"]) ta.with_defaults({ :aa => 'default_val' }) diff --git a/test/rake/test_task_manager.rb b/test/rake/test_task_manager.rb index 1e92e25fbf..3ab039ca85 100644 --- a/test/rake/test_task_manager.rb +++ b/test/rake/test_task_manager.rb @@ -135,7 +135,7 @@ class Rake::TestTaskManager < Test::Unit::TestCase end end assert_equal t1, @tm[:t, []] - assert_equal t2, @tm[:t, ["a"]] + assert_equal t2, @tm[:t, ["a"]] assert_equal t3, @tm[:t, ["a", "b"]] assert_equal s, @tm[:s, ["a", "b"]] assert_equal s, @tm[:s, ["a"]] @@ -153,7 +153,7 @@ class Rake::TestTaskManager < Test::Unit::TestCase @tm["a:x"].invoke assert_equal ["next z"], values end - + end class Rake::TestTaskManagerArgumentResolution < Test::Unit::TestCase diff --git a/test/rake/test_test_task.rb b/test/rake/test_test_task.rb index a0dc7a0717..0b7dbc625b 100644 --- a/test/rake/test_test_task.rb +++ b/test/rake/test_test_task.rb @@ -4,7 +4,7 @@ require 'rake/testtask' class Rake::TestTestTask < Test::Unit::TestCase include Rake - + def setup @oldwd = Dir.pwd @tmpwd = Dir.mktmpdir diff --git a/test/rdoc/test_rdoc_context_section.rb b/test/rdoc/test_rdoc_context_section.rb index 1636c98246..d37a4d222e 100644 --- a/test/rdoc/test_rdoc_context_section.rb +++ b/test/rdoc/test_rdoc_context_section.rb @@ -5,7 +5,7 @@ require 'rdoc' require 'rdoc/code_objects' class TestRDocContextSection < MiniTest::Unit::TestCase - + def setup @S = RDoc::Context::Section @s = @S.new nil, 'section', '# comment' diff --git a/test/rdoc/test_rdoc_parser_ruby.rb b/test/rdoc/test_rdoc_parser_ruby.rb index 6c2b445ef3..87ac45a073 100644 --- a/test/rdoc/test_rdoc_parser_ruby.rb +++ b/test/rdoc/test_rdoc_parser_ruby.rb @@ -2067,7 +2067,7 @@ end foo = @top_level.classes.first - assert_equal "= DESCRIPTION\n\nThis is a simple test class\n\n= RUMPUS\n\nIs a silly word", + assert_equal "= DESCRIPTION\n\nThis is a simple test class\n\n= RUMPUS\n\nIs a silly word", foo.comment m = foo.method_list.first diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index fc1e719462..a504fa5e2f 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -118,8 +118,8 @@ class TestReadline < Test::Unit::TestCase stdin.close(true) stdout.close(true) end - end - + end + # line_buffer # point def test_line_buffer__point @@ -129,7 +129,7 @@ class TestReadline < Test::Unit::TestCase rescue NotImplementedError return end - + stdin = Tempfile.new("test_readline_stdin") stdout = Tempfile.new("test_readline_stdout") begin diff --git a/test/rexml/test_attributes.rb b/test/rexml/test_attributes.rb index 51a7774b0f..e46850de3a 100644 --- a/test/rexml/test_attributes.rb +++ b/test/rexml/test_attributes.rb @@ -91,10 +91,10 @@ class AttributesTester < Test::Unit::TestCase # Submitted by Kou def test_namespace_conflict - assert_raise( ParseException, + assert_raise( ParseException, "Declaring two attributes with the same namespace should be an error" ) do REXML::Document.new <<-XML - diff --git a/test/rexml/test_contrib.rb b/test/rexml/test_contrib.rb index eb16b8946c..7d00202c95 100644 --- a/test/rexml/test_contrib.rb +++ b/test/rexml/test_contrib.rb @@ -92,7 +92,7 @@ DELIMITER doc = REXML::Document.new source assert_equal "myprog-config", doc.root.name count = 0 - REXML::XPath.each(doc, "x:myprog-config/x:main/x:parameter", + REXML::XPath.each(doc, "x:myprog-config/x:main/x:parameter", {"x"=>"http://someurl/program/version"}) { |element| assert_equal "name", element.attributes["name"] count += 1; @@ -183,7 +183,7 @@ DELIMITER result = XPath.first(doc, xpath) assert_equal desired_result.to_s, result.to_s end - + def test_xpath_whitespace_TobiasReif # same as above, with whitespace in XPath doc = Document.new(XML_STRING_01.dup) @@ -193,7 +193,7 @@ DELIMITER failure_message = "\n[[[TR: AFAIK, whitespace should be allowed]]]\n" assert_equal(desired_result.to_s, result.to_s, failure_message) end - + def test_xpath_02_TobiasReif doc = Document.new XML_STRING_01.dup desired_result = Document.new 'Thomas, David; Hunt, Andrew' @@ -211,7 +211,7 @@ DELIMITER failure_message = "\nHow to handle the apos inside the string inside the XPath?\nXPath = #{xpath}\n" assert_equal desired_result.to_s, result.to_s, failure_message end - + def test_xpath_03_TobiasReif doc = Document.new XML_STRING_02.dup desired_result_string = " @@ -303,7 +303,7 @@ EOF assert_nil XPath.first(doc,'//leg') assert_equal 'http://www.foo.com/human', doc.root.elements[1].namespace - assert_equal 'human leg', + assert_equal 'human leg', XPath.first(doc, '//x:leg/text()', {'x'=>'http://www.foo.com/human'}).to_s end @@ -312,8 +312,8 @@ EOF source = File.new(fixture_path('ProductionSupport.xml')) h = Hash.new doc = REXML::Document.new source - doc.elements.each("//CommonError") { |el| - h[el.elements['Key'].text] = 'okay' + doc.elements.each("//CommonError") { |el| + h[el.elements['Key'].text] = 'okay' } assert(h.include?('MotorInsuranceContract(Object)>>#error:')) end @@ -426,7 +426,7 @@ EOF assert text !~ /&rbconfig/, "'#{text}' failed" end - #Error occurred in test_package_file_opens(TC_PackageInstall): + #Error occurred in test_package_file_opens(TC_PackageInstall): # ArgumentError: #illegal access mode &rbconfig.prefix;/lib/rexml # @@ -464,7 +464,7 @@ EOL end end - def test_maintain_dtd + def test_maintain_dtd src = %q{ diff --git a/test/rexml/test_doctype.rb b/test/rexml/test_doctype.rb index 20603f5378..0a87c0a304 100644 --- a/test/rexml/test_doctype.rb +++ b/test/rexml/test_doctype.rb @@ -18,7 +18,7 @@ class TestDocTypeAccessor < Test::Unit::TestCase XMLEND @doctype1 = REXML::Document.new(document_string1).doctype - + @pubid = "TEST_ID" document_string2 = <<-"XMLEND" @@ -31,15 +31,15 @@ class TestDocTypeAccessor < Test::Unit::TestCase XMLEND @doctype3 = REXML::Document.new(document_string3).doctype - + end - + def test_public assert_equal(nil, @doctype1.public) assert_equal(@pubid, @doctype2.public) assert_equal(@pubid, @doctype3.public) end - + def test_system assert_equal(@sysid, @doctype1.system) assert_equal(nil, @doctype2.system) @@ -50,20 +50,20 @@ class TestDocTypeAccessor < Test::Unit::TestCase assert_equal(@notid1, @doctype1.notation("n1").system) assert_equal(@notid2, @doctype1.notation("n2").system) end - + def test_notations notations = @doctype1.notations assert_equal(2, notations.length) assert_equal(@notid1, find_notation(notations, "n1").system) assert_equal(@notid2, find_notation(notations, "n2").system) end - + def find_notation(notations, name) notations.find { |notation| name == notation.name } end - + end class TestNotationDeclPublic < Test::Unit::TestCase diff --git a/test/rexml/test_elements.rb b/test/rexml/test_elements.rb index 210004a1c0..424b2a2c9b 100644 --- a/test/rexml/test_elements.rb +++ b/test/rexml/test_elements.rb @@ -19,16 +19,16 @@ class ElementsTester < Test::Unit::TestCase doc.root.elements['c'] = Element.new('d') assert_equal 'd', doc.root.elements[1].name end - + def test_elements_delete doc = Document.new '' - block = proc { |str| + block = proc { |str| out = '' doc.write out - assert_equal str, out + assert_equal str, out } b = doc.root.elements[1] - doc.root.elements.delete b + doc.root.elements.delete b block.call( "" ) doc.elements.delete("a/c[@id='1']") block.call( '' ) @@ -90,13 +90,13 @@ class ElementsTester < Test::Unit::TestCase assert_equal 2, doc.root.elements.to_a("child::node()").size assert_equal 4, XPath.match(doc.root, "child::node()").size end - + def test_elements_collect doc = Document.new( "" ) r = doc.elements.collect( "/a/b" ) { |e| e.attributes["id"].to_i } assert_equal( [1,2], r ) end - + def test_elements_inject doc = Document.new( "" ) r = doc.elements.inject( "/a/b", 3 ) { |s, e| diff --git a/test/rexml/test_encoding_2.rb b/test/rexml/test_encoding_2.rb index 2e845b58a0..6a985f3897 100644 --- a/test/rexml/test_encoding_2.rb +++ b/test/rexml/test_encoding_2.rb @@ -44,7 +44,7 @@ END end end - if broken_encodings > 0 + if broken_encodings > 0 fail "There were #{broken_encodings} encoding failures out of #{UnixCharsets.size} plus some REXML internal encodings" else fail "There were no encoding failures" diff --git a/test/rexml/test_entity.rb b/test/rexml/test_entity.rb index 5219004a49..e6d6f29007 100644 --- a/test/rexml/test_entity.rb +++ b/test/rexml/test_entity.rb @@ -10,23 +10,23 @@ class EntityTester < Test::Unit::TestCase simple =~ /#{REXML::Entity::GEDECL}/ assert $& assert_equal simple, $& - + REXML::Entity::ENTITYDECL =~ simple assert REXML::Entity::matches?(simple) match = REXML::Entity::ENTITYDECL.match(simple) assert_equal 'foo', match[1] assert_equal "'bar'", match[2] - simple = '' assert REXML::Entity::matches?(simple) match = REXML::Entity::ENTITYDECL.match(simple) assert_equal 'Pub-Status', match[1] assert_equal '"This is a pre-release of the specification."', match[2] - txt = '"This is a + txt = '"This is a pre-release of specification."' - simple = "" assert REXML::Entity::matches?(simple) match = REXML::Entity::ENTITYDECL.match(simple) @@ -117,7 +117,7 @@ class EntityTester < Test::Unit::TestCase source = ' ]>replace &ent;' - doc = REXML::Document.new( source ) + doc = REXML::Document.new( source ) assert_equal(source, doc.to_s) assert_equal("replace replace", doc.root.text) assert_equal(source, doc.to_s) diff --git a/test/rexml/test_functions.rb b/test/rexml/test_functions.rb index e0f8a67fc1..082d772e23 100644 --- a/test/rexml/test_functions.rb +++ b/test/rexml/test_functions.rb @@ -155,7 +155,7 @@ class FunctionsTester < Test::Unit::TestCase id_1 = doc.elements["/a/b[@id='1']"] id_2 = doc.elements["/a/b[@id='2']"] id_3 = doc.elements["/a/b[@id='3']"] - + good = { "floor" => [[], [id_1], [id_2], [id_3]], "ceiling" => [[id_1], [id_2], [id_3], []], diff --git a/test/rexml/test_jaxen.rb b/test/rexml/test_jaxen.rb index 1870928438..222cf79c60 100644 --- a/test/rexml/test_jaxen.rb +++ b/test/rexml/test_jaxen.rb @@ -41,18 +41,18 @@ class JaxenTester < Test::Unit::TestCase file = File.new(fixture_path(fname+".xml")) doc = Document.new( file ) XPath.each( doc, "/tests/document" ) {|e| handleDocument(e)} -# end +# end # } end - # processes a tests/document/context node + # processes a tests/document/context node def handleContext( testDoc, ctxElement) testCtx = XPath.match( testDoc, ctxElement.attributes["select"] )[0] - namespaces = {} + namespaces = {} if testCtx.class == Element - testCtx.prefixes.each { |pre| handleNamespace( testCtx, pre, namespaces ) } + testCtx.prefixes.each { |pre| handleNamespace( testCtx, pre, namespaces ) } end - variables = {} + variables = {} XPath.each( ctxElement, "@*[namespace-uri() = 'http://jaxen.org/test-harness/var']") { |attrib| handleVariable(testCtx, variables, attrib) } XPath.each( ctxElement, "valueOf") { |e| handleValueOf(testCtx, variables, namespaces, e) } XPath.each( ctxElement, "test[not(@exception) or (@exception != 'true') ]") { |e| handleNominalTest(testCtx,variables, namespaces, e) } @@ -61,7 +61,7 @@ class JaxenTester < Test::Unit::TestCase # processes a tests/document/context/valueOf or tests/document/context/test/valueOf node def handleValueOf(ctx,variables, namespaces, valueOfElement) - expected = valueOfElement.text + expected = valueOfElement.text got = XPath.match( ctx, valueOfElement.attributes["select"], namespaces, variables )[0] assert_true( (got.nil? && expected.nil?) || !got.nil? ) case got.class @@ -71,10 +71,10 @@ class JaxenTester < Test::Unit::TestCase assert_equal( expected, got.to_s ) when Instruction assert_equal( expected, got.content ) - when Fixnum + when Fixnum assert_equal( exected.to_f, got ) when String - # normalize values for comparison + # normalize values for comparison got = "" if got == nil or got == "" expected = "" if expected == nil or expected == "" assert_equal( expected, got ) @@ -82,45 +82,45 @@ class JaxenTester < Test::Unit::TestCase assert_fail( "Wassup?" ) end end - - + + # processes a tests/document/context/test node ( where @exception is false or doesn't exist ) def handleNominalTest(ctx, variables, namespaces, testElement) - expected = testElement.attributes["count"] + expected = testElement.attributes["count"] got = XPath.match( ctx, testElement.attributes["select"], namespaces, variables ) # might be a test with no count attribute, but nested valueOf elements assert( expected == got.size.to_s ) if !expected.nil? - - XPath.each( testElement, "valueOf") { |e| - handleValueOf(got, variables, namespaces, e) + + XPath.each( testElement, "valueOf") { |e| + handleValueOf(got, variables, namespaces, e) } end - - # processes a tests/document/context/test node ( where @exception is true ) + + # processes a tests/document/context/test node ( where @exception is true ) def handleExceptionalTest(ctx, variables, namespaces, testElement) assert_raise( Exception ) { XPath.match( ctx, testElement.attributes["select"], namespaces, variables ) } end - # processes a tests/document node + # processes a tests/document node def handleDocument(docElement) puts "- Processing document: #{docElement.attributes['url']}" testFile = File.new( docElement.attributes["url"] ) testDoc = Document.new testFile XPath.each( docElement, "context") { |e| handleContext(testDoc, e) } end - - # processes a variable definition in a namespace like + + # processes a variable definition in a namespace like def handleVariable( ctx, variables, attrib ) puts "--- Found attribute: #{attrib.name}" variables[attrib.name] = attrib.value end - - # processes a namespace definition like + + # processes a namespace definition like def handleNamespace( ctx, prefix, namespaces ) puts "--- Found namespace: #{prefix}" - namespaces[prefix] = ctx.namespaces[prefix] + namespaces[prefix] = ctx.namespaces[prefix] end - + end diff --git a/test/rexml/test_light.rb b/test/rexml/test_light.rb index 3b9e8adfec..1b56159254 100644 --- a/test/rexml/test_light.rb +++ b/test/rexml/test_light.rb @@ -12,7 +12,7 @@ class LightTester < Test::Unit::TestCase tag, content = parser.parse assert_equal([:document, :text], [tag, content.first]) end - + # FIXME INCOMPLETE # This is because the light API is not yet ready to be used to produce # trees. @@ -22,7 +22,7 @@ class LightTester < Test::Unit::TestCase foo = doc.add_element( 'foo' ) assert_equal( "foo", foo.name ) end - + def test_add_attribute foo = Node.new( "a" ) foo["attr"] = "bar" diff --git a/test/rexml/test_listener.rb b/test/rexml/test_listener.rb index f2cc4b7c35..0afbdcd5ff 100644 --- a/test/rexml/test_listener.rb +++ b/test/rexml/test_listener.rb @@ -11,7 +11,7 @@ class BaseTester < Test::Unit::TestCase return unless defined? @listener # Empty. t1 = %Q{} - assert_equal( "", @listener.parse( t1 ), + assert_equal( "", @listener.parse( t1 ), "Empty" ) end @@ -59,11 +59,11 @@ class BaseTester < Test::Unit::TestCase return unless defined? @listener # CR. t7 = %Q{ \r\n \r \n } - assert_equal( " \n \n \n ".unpack("C*").inspect, + assert_equal( " \n \n \n ".unpack("C*").inspect, @listener.parse( t7 ).unpack("C*").inspect, "CR" ) end - # The accent bug, and the code that exibits the bug, was contributed by + # The accent bug, and the code that exibits the bug, was contributed by # Guilhem Vellut class AccentListener def tag_start(name,attributes) diff --git a/test/rexml/test_notationdecl_mixin.rb b/test/rexml/test_notationdecl_mixin.rb index d5212534c1..68dcc555ac 100644 --- a/test/rexml/test_notationdecl_mixin.rb +++ b/test/rexml/test_notationdecl_mixin.rb @@ -31,11 +31,11 @@ class TestNotationDeclMixin < Test::Unit::TestCase XMLEND @doctype = REXML::Document.new(doc_string).doctype end - + def test_name assert_equal('n1', @doctype.notation('n1').name) end - + def test_public_2 assert_equal(@pubid1, @doctype.notation('n1').public) assert_equal(@pubid2, @doctype.notation('n2').public) @@ -45,7 +45,7 @@ class TestNotationDeclMixin < Test::Unit::TestCase assert_equal(@pubid6, @doctype.notation('n6').public) assert_nil(@doctype.notation('n7').public) end - + def test_system_2 assert_equal(@sysid2, @doctype.notation('n2').system) assert_nil(@doctype.notation('n3').system) diff --git a/test/rexml/test_notationdecl_parsetest.rb b/test/rexml/test_notationdecl_parsetest.rb index 6a8449e37d..2e86d322e0 100644 --- a/test/rexml/test_notationdecl_parsetest.rb +++ b/test/rexml/test_notationdecl_parsetest.rb @@ -14,7 +14,7 @@ class TestNotationDecl < Test::Unit::TestCase XMLEND @doctype = REXML::Document.new(doc_string).doctype end - + def test_notation assert(@doctype.notation('n1'), "Testing notation n1") assert(@doctype.notation('n2'), "Testing notation n2") diff --git a/test/rexml/test_pullparser.rb b/test/rexml/test_pullparser.rb index 1c9bcc0045..bfce60f268 100644 --- a/test/rexml/test_pullparser.rb +++ b/test/rexml/test_pullparser.rb @@ -21,19 +21,19 @@ class PullParserTester < Test::Unit::TestCase end res[ :text ] += 1 if results.text? end - [ :xmldecl, :doctype, :a, :b ].each { |tag| + [ :xmldecl, :doctype, :a, :b ].each { |tag| assert res[tag] , "#{tag} wasn't processed" } - assert_equal 4, res[ :text ] - rescue ParseException + assert_equal 4, res[ :text ] + rescue ParseException puts $! end def test_bad_document source = "" parser = REXML::Parsers::PullParser.new(source) - assert_raise(ParseException, "Parsing should have failed") { - results = parser.pull while parser.has_next? + assert_raise(ParseException, "Parsing should have failed") { + results = parser.pull while parser.has_next? } end diff --git a/test/rexml/test_sax.rb b/test/rexml/test_sax.rb index 569270ceb1..f5d7fb44ce 100644 --- a/test/rexml/test_sax.rb +++ b/test/rexml/test_sax.rb @@ -41,7 +41,7 @@ class SAX2Tester < Test::Unit::TestCase } start_document = 0 - end_document = 0 + end_document = 0 parser.listen( :start_document ) { start_document += 1 } parser.listen( :end_document ) { end_document += 1 } parser.listen( :start_element, %w{ changelog bugs todo }, &blok ) @@ -69,8 +69,8 @@ class SAX2Tester < Test::Unit::TestCase assert(text=~/@ANT_VERSION@/, "version was '#{text}'") tc += 1 } - - begin + + begin parser.parse rescue => exception if exception.kind_of? Test::Unit::AssertionFailedError @@ -255,12 +255,12 @@ class SAX2Tester < Test::Unit::TestCase assert_equal(252, result[0]) end - class Ticket68 - include REXML::SAX2Listener - end + class Ticket68 + include REXML::SAX2Listener + end def test_ticket_68 parser = REXML::Parsers::SAX2Parser.new(File.new(fixture_path('ticket_68.xml'))) - parser.listen( Ticket68.new ) + parser.listen( Ticket68.new ) begin parser.parse rescue diff --git a/test/rexml/test_stream.rb b/test/rexml/test_stream.rb index 2d9c177008..3f876aed35 100644 --- a/test/rexml/test_stream.rb +++ b/test/rexml/test_stream.rb @@ -12,11 +12,11 @@ class StreamTester < Test::Unit::TestCase # Submitted by Han Holl def test_listener data = %Q{\n} - + b = RequestReader.new( data ) b = RequestReader.new( data ) end - + def test_ticket_49 source = StringIO.new( <<-EOL ) XYZ} ) no_error( validator, %q{Option 1} ) no_error( validator, %q{Option 2} ) - + # Attribute values rng = %q{ @@ -772,13 +772,13 @@ class RNGValidation < Test::Unit::TestCase error( validator, %q{} ) error( validator, %q{} ) end - + def error( validator, source ) parser = REXML::Parsers::TreeParser.new( source ) parser.add_listener( validator.reset ) - assert_raise( REXML::Validation::ValidationException, + assert_raise( REXML::Validation::ValidationException, "Expected a validation error" ) { parser.parse } end diff --git a/test/rexml/test_xml_declaration_parent_child.rb b/test/rexml/test_xml_declaration_parent_child.rb index 6386bed4f1..d883e105c1 100644 --- a/test/rexml/test_xml_declaration_parent_child.rb +++ b/test/rexml/test_xml_declaration_parent_child.rb @@ -17,15 +17,15 @@ class TestXmlDeclaration < Test::Unit::TestCase @root = @doc.root @xml_declaration = @doc.children[0] end - + def test_xml_declaration_is_first_child assert_kind_of(REXML::XMLDecl, @xml_declaration) end - + def test_xml_declaration_has_document_as_parent assert_kind_of(REXML::Document, @xml_declaration.parent) end - + def test_xml_declaration_has_sibling assert_kind_of(REXML::XMLDecl, @root.previous_sibling.previous_sibling) assert_kind_of(REXML::Element, @xml_declaration.next_sibling.next_sibling) diff --git a/test/rexml/test_xpath.rb b/test/rexml/test_xpath.rb index d7ab9620a8..ad09fcafb2 100644 --- a/test/rexml/test_xpath.rb +++ b/test/rexml/test_xpath.rb @@ -163,7 +163,7 @@ class XPathTester < Test::Unit::TestCase #res = XPath::first(doc, "*") #assert_equal "a", res.name - assert_equal( :processing_instruction, + assert_equal( :processing_instruction, XPath::first(doc.root, "processing-instruction()").node_type) assert_equal( :comment, XPath::first(doc.root, "comment()").node_type) end @@ -206,7 +206,7 @@ class XPathTester < Test::Unit::TestCase # Here are some XPath tests that were originally submitted by ... # The code has changed some, but the logic and the source documents are the # same. - # This method reads a document from a file, and then a series of xpaths, + # This method reads a document from a file, and then a series of xpaths, # also from a file. It then checks each xpath against the source file. def test_more xmlsource = fixture_path("testsrc.xml") @@ -222,7 +222,7 @@ class XPathTester < Test::Unit::TestCase rt = doc.root #puts "#"*80 #print "\nDoing #{line} " ; $stdout.flush - doc.elements.each(line) do |el| + doc.elements.each(line) do |el| #print "." ; $stdout.flush results.root << el.clone #results << el.to_s @@ -255,7 +255,7 @@ class XPathTester < Test::Unit::TestCase result = XPath::first( @@doc, "descendant::f[@a='c']") assert_equal "11", result.attributes['id'] - + assert_equal "11", XPath::first(@@doc, "a/e/f[@a='c']").attributes["id"] assert_equal "11", XPath::first(@@doc, "a/e/*[@a='c']").attributes["id"] end @@ -282,9 +282,9 @@ class XPathTester < Test::Unit::TestCase d = XPath.first( doc, "//d" ) assert_equal "d", d.name b = each_test( d, "ancestor::b" ) { |el| - assert((1..2) === el.attributes['id'].to_i, + assert((1..2) === el.attributes['id'].to_i, "Expected #{el.attributes['id']} to be either 1 or 2" - ) + ) } assert_equal 2, b end @@ -316,7 +316,7 @@ class XPathTester < Test::Unit::TestCase def test_lang doc = Document.new(File.new(fixture_path("lang0.xml"))) #puts IO.read( "test/lang.xml" ) - + #puts XPath.match( doc, "//language/*" ).size c = each_test( doc, "//language/*" ) { |element| #puts "#{element.name}: #{element.text}" @@ -428,9 +428,9 @@ class XPathTester < Test::Unit::TestCase assert_equal 2, res.size end - # The following three paths were provided by + # The following three paths were provided by # Jeni Tennison - # a consultant who is also an XSL and XPath expert + # a consultant who is also an XSL and XPath expert #def test_child_cubed # els = @@jeni.elements.to_a("*****") # assert_equal 3, els.size @@ -445,7 +445,7 @@ class XPathTester < Test::Unit::TestCase # results = @@jeni.root.elements[1].elements[1].elements.to_a("../following-sibling::*[*[name() = name(current())]]") # puts results #end - + # Contributed by Mike Stok def test_starts_with source = <<-EOF @@ -511,7 +511,7 @@ class XPathTester < Test::Unit::TestCase doc = Document.new source [ - #['o', 2], + #['o', 2], ['foo', 1], ['bar', 0]].each { |search, expected| set = doc.elements.to_a("//a[contains(@href, '#{search}')]") assert_equal expected, set.size @@ -614,7 +614,7 @@ class XPathTester < Test::Unit::TestCase assert_equal 1, REXML::XPath.match(doc, "//b[number(@id) = (1 mod 2)]").size assert_equal 1, REXML::XPath.match(doc, "//b[number(@id) = (4 div 2)]").size end - + # Contributed by Kouhei def test_substring_before doc = Document.new("") @@ -629,27 +629,27 @@ class XPathTester < Test::Unit::TestCase ") - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, "//*[local-name()='c' and @id='b']").size ) - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, "//*[ local-name()='c' and @id='b' ]").size ) - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, "//*[ local-name() = 'c' and @id = 'b' ]").size ) - assert_equal( 1, + assert_equal( 1, REXML::XPath.match(doc, '/a/c[@id]').size ) assert_equal( 1, REXML::XPath.match(doc, '/a/c[(@id)]').size ) - assert_equal( 1, + assert_equal( 1, REXML::XPath.match(doc, '/a/c[ @id ]').size ) - assert_equal( 1, + assert_equal( 1, REXML::XPath.match(doc, '/a/c[ (@id) ]').size ) - assert_equal( 1, + assert_equal( 1, REXML::XPath.match(doc, '/a/c[( @id )]').size ) - assert_equal( 1, REXML::XPath.match(doc.root, + assert_equal( 1, REXML::XPath.match(doc.root, '/a/c[ ( @id ) ]').size ) - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, '/a/c [ ( @id ) ] ').size ) - assert_equal( 1, REXML::XPath.match(doc, + assert_equal( 1, REXML::XPath.match(doc, ' / a / c [ ( @id ) ] ').size ) end @@ -719,8 +719,8 @@ class XPathTester < Test::Unit::TestCase end def test_and - d = Document.new %q{} assert_equal( nil, d.root.elements["route[@run='0']"] ) assert_equal( nil, d.root.elements["route[@run='0' and @title='HNO']"] ) @@ -803,7 +803,7 @@ class XPathTester < Test::Unit::TestCase EOL rd = REXML::Document.new( src ) union = rd.get_elements('//em|//strong') - assert_equal(2, union.length, + assert_equal(2, union.length, 'Both tag types are returned by XPath union operator') end @@ -828,7 +828,7 @@ class XPathTester < Test::Unit::TestCase d = REXML::Document.new( string ) c1 = XPath.match( d, '/a/*/*[1]' ) assert_equal( 1, c1.length ) - assert_equal( 'c1', c1[0].name ) + assert_equal( 'c1', c1[0].name ) end def test_sum @@ -872,25 +872,25 @@ class XPathTester < Test::Unit::TestCase EOL - root_node = XPath.first(doc, "rss") - assert_not_nil root_node - channel_node = XPath.first(root_node, "channel") - assert_not_nil channel_node - items = XPath.match(channel_node, "*") - assert_equal 4, items.size - items = XPath.match(channel_node, "item") + root_node = XPath.first(doc, "rss") + assert_not_nil root_node + channel_node = XPath.first(root_node, "channel") + assert_not_nil channel_node + items = XPath.match(channel_node, "*") + assert_equal 4, items.size + items = XPath.match(channel_node, "item") assert_equal 3, items.size # fails end def test_ticket_42 - source = "" - doc = Document.new(source) - bElem = Element.new('b') - doc.root.add_element(bElem) - doc.elements.each('//b[name(..) = "a"]') { |x| - assert_equal x,bElem - } + source = "" + doc = Document.new(source) + bElem = Element.new('b') + doc.root.add_element(bElem) + doc.elements.each('//b[name(..) = "a"]') { |x| + assert_equal x,bElem + } end def test_ticket_56 @@ -900,7 +900,7 @@ class XPathTester < Test::Unit::TestCase column_headers = [] - REXML::XPath.each(finaldoc, '//h:form[@action="ModifyCampaign"]//h:th', + REXML::XPath.each(finaldoc, '//h:form[@action="ModifyCampaign"]//h:th', namespaces) do |el| node = REXML::XPath.first(el, 'h:a/text()', namespaces) column_headers << (node ? node.value : nil) @@ -915,17 +915,17 @@ class XPathTester < Test::Unit::TestCase def test_ticket_70 string = < - Text1, text, -text + - Text2, text, -text + Text1, text, +text - - + Text2, text, +text + + + EOF doc = Document.new string @@ -933,7 +933,7 @@ EOF end def test_ticket_43 - #url = http://news.search.yahoo.com/news/rss?p=market&ei=UTF-8&fl=0&x=wrt + #url = http://news.search.yahoo.com/news/rss?p=market&ei=UTF-8&fl=0&x=wrt sum = Document.new(File.new(fixture_path("yahoo.xml"))).elements.to_a("//item").size assert_equal( 10, sum ) @@ -988,12 +988,12 @@ EOF def ticket_61_fixture(doc, xpath) matches = [] doc.elements.each(xpath) do |element| - matches << element - assert_equal('Add', element.text) + matches << element + assert_equal('Add', element.text) assert_equal('ButtonText', element.attributes['class']) end assert_equal(1, matches.length) - end + end def test_ticket_61_text file = File.open(fixture_path("ticket_61.xml")) diff --git a/test/rexml/test_xpath_attribute_query.rb b/test/rexml/test_xpath_attribute_query.rb index 99439f2286..c0ad2c2e8c 100644 --- a/test/rexml/test_xpath_attribute_query.rb +++ b/test/rexml/test_xpath_attribute_query.rb @@ -6,7 +6,7 @@ require 'test/unit' require 'rexml/document' class TestRexmlXpathAttributeQuery < Test::Unit::TestCase - + # xmlstr1 and xmlstr2 only differ in the second line - namespaces in the root element @@xmlstr1 = ' @@ -26,7 +26,7 @@ class TestRexmlXpathAttributeQuery < Test::Unit::TestCase ' - + @@xmlstr2 = ' http://www.google.com/calendar/feeds/me%40gmail.com @@ -44,22 +44,22 @@ class TestRexmlXpathAttributeQuery < Test::Unit::TestCase ' - + # Fails def test_xpath_query do_test @@xmlstr1 end - + # Passes def test_xpath_query_no_namespace do_test @@xmlstr2 end - + def do_test(xmlString) - hrefs = [ - "http://www.google.com/calendar/feeds/me%40gmail.com/private/full", - "http://www.google.com/calendar/feeds/me%40gmail.com/acl/full", - "http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com" + hrefs = [ + "http://www.google.com/calendar/feeds/me%40gmail.com/private/full", + "http://www.google.com/calendar/feeds/me%40gmail.com/acl/full", + "http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com" ] ctr=0 REXML::Document.new(xmlString).elements.each("feed/entry") do |element| @@ -70,13 +70,13 @@ class TestRexmlXpathAttributeQuery < Test::Unit::TestCase end end - + def test_another_way doc = REXML::Document.new(@@xmlstr1) - hrefs = [ - "http://www.google.com/calendar/feeds/me%40gmail.com/private/full", - "http://www.google.com/calendar/feeds/me%40gmail.com/acl/full", - "http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com" + hrefs = [ + "http://www.google.com/calendar/feeds/me%40gmail.com/private/full", + "http://www.google.com/calendar/feeds/me%40gmail.com/acl/full", + "http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com" ] ctr=0 REXML::XPath.each(doc, "//link[@rel='alternate']") do |element| diff --git a/test/rexml/test_xpath_pred.rb b/test/rexml/test_xpath_pred.rb index 373a7f562b..584358966a 100644 --- a/test/rexml/test_xpath_pred.rb +++ b/test/rexml/test_xpath_pred.rb @@ -20,7 +20,7 @@ class XPathPredicateTester < Test::Unit::TestCase EOL - + def setup @doc = REXML::Document.new( SRC ) @parser = REXML::Parsers::XPathParser.new @@ -48,8 +48,8 @@ class XPathPredicateTester < Test::Unit::TestCase assert_equal( 1, m.size ) assert_equal( "1", m[0].attributes["id"] ) end - - def do_path( path ) + + def do_path( path ) m = REXML::XPath.match( @doc, path ) #puts path, @parser.parse( path ).inspect return m diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index b7f1a0093b..3eebbfafca 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -462,7 +462,7 @@ class TestMarshal < Test::Unit::TestCase attr_reader :foo end private_constant :PrivateClass - + def test_marshal_private_class o1 = PrivateClass.new("test") o2 = Marshal.load(Marshal.dump(o1)) diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 10b2708804..0dcfeccef9 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -141,7 +141,7 @@ class TestModule < Test::Unit::TestCase :bClass3 end end - + class CClass < BClass def self.cClass end diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 66faa70a76..743b71d73f 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -146,7 +146,7 @@ class TestSuper < Test::Unit::TestCase @first or fail end - def subseq + def subseq @first or fail end end diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 838a7692f7..6a00b99443 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -176,7 +176,7 @@ class TestTime < Test::Unit::TestCase t = Time.at(2**40 + "1/3".to_r, 9999999999999).utc assert_equal(36812, t.year) - + t = Time.at(-0x3fff_ffff_ffff_ffff) assert_equal(-146138510344, t.year) t = Time.at(-0x4000_0000_0000_0000) diff --git a/test/rubygems/test_gem_commands_unpack_command.rb b/test/rubygems/test_gem_commands_unpack_command.rb index 8291a6b949..8764a4017b 100644 --- a/test/rubygems/test_gem_commands_unpack_command.rb +++ b/test/rubygems/test_gem_commands_unpack_command.rb @@ -21,7 +21,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase util_make_gems assert_equal( - @cmd.find_in_cache(@a1.file_name), + @cmd.find_in_cache(@a1.file_name), Gem.cache_gem(@a1.file_name, @gemhome), 'found a-1.gem in the cache' ) @@ -31,7 +31,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase util_make_gems util_setup_fake_fetcher util_setup_spec_fetcher @a1 - + a1_data = nil open Gem.cache_gem(@a1.file_name, @gemhome), 'rb' do |fp| @@ -40,19 +40,19 @@ class TestGemCommandsUnpackCommand < Gem::TestCase Gem::RemoteFetcher.fetcher.data['http://gems.example.com/gems/a-1.gem'] = a1_data - + dep = Gem::Dependency.new(@a1.name, @a1.version) assert_equal( - @cmd.get_path(dep), - Gem.cache_gem(@a1.file_name, @gemhome), + @cmd.get_path(dep), + Gem.cache_gem(@a1.file_name, @gemhome), 'fetches a-1 and returns the cache path' ) FileUtils.rm Gem.cache_gem(@a1.file_name, @gemhome) assert_equal( - @cmd.get_path(dep), - Gem.cache_gem(@a1.file_name, @gemhome), + @cmd.get_path(dep), + Gem.cache_gem(@a1.file_name, @gemhome), 'when removed from cache, refetches a-1' ) end diff --git a/test/rubygems/test_gem_platform.rb b/test/rubygems/test_gem_platform.rb index 666669b233..485bab72a2 100644 --- a/test/rubygems/test_gem_platform.rb +++ b/test/rubygems/test_gem_platform.rb @@ -235,7 +235,7 @@ class TestGemPlatform < Gem::TestCase util_set_arch 'java' assert_match 'java', Gem::Platform.local assert_match 'jruby', Gem::Platform.local - + util_set_arch 'universal-dotnet2.0' assert_match 'universal-dotnet', Gem::Platform.local assert_match 'universal-dotnet-2.0', Gem::Platform.local @@ -243,13 +243,13 @@ class TestGemPlatform < Gem::TestCase assert_match 'dotnet', Gem::Platform.local assert_match 'dotnet-2.0', Gem::Platform.local refute_match 'dotnet-4.0', Gem::Platform.local - + util_set_arch 'universal-dotnet4.0' assert_match 'universal-dotnet', Gem::Platform.local - refute_match 'universal-dotnet-2.0', Gem::Platform.local + refute_match 'universal-dotnet-2.0', Gem::Platform.local assert_match 'universal-dotnet-4.0', Gem::Platform.local assert_match 'dotnet', Gem::Platform.local - refute_match 'dotnet-2.0', Gem::Platform.local + refute_match 'dotnet-2.0', Gem::Platform.local assert_match 'dotnet-4.0', Gem::Platform.local util_set_arch 'powerpc-darwin' diff --git a/test/rubygems/test_gem_silent_ui.rb b/test/rubygems/test_gem_silent_ui.rb index 1968a89b28..8005b3b1cc 100644 --- a/test/rubygems/test_gem_silent_ui.rb +++ b/test/rubygems/test_gem_silent_ui.rb @@ -55,7 +55,7 @@ class TestGemSilentUI < Gem::TestCase assert_empty out, 'No output' assert_empty err, 'No output' - + out, err = capture_io do use_ui @sui do value = @sui.ask_yes_no 'Problem?', true @@ -66,7 +66,7 @@ class TestGemSilentUI < Gem::TestCase assert_empty err, 'No output' assert value, 'Value is true' - + out, err = capture_io do use_ui @sui do value = @sui.ask_yes_no 'Problem?', false diff --git a/test/syck/test_null.rb b/test/syck/test_null.rb index b38bf50fba..8bd710fe5e 100644 --- a/test/syck/test_null.rb +++ b/test/syck/test_null.rb @@ -11,7 +11,7 @@ module Syck --- - ~ - null -- +- - Null - NULL eoyml diff --git a/test/syck/test_struct.rb b/test/syck/test_struct.rb index 547c5f2d71..8d4c538d98 100644 --- a/test/syck/test_struct.rb +++ b/test/syck/test_struct.rb @@ -30,7 +30,7 @@ module Syck def test_load obj = YAML.load(<<-eoyml) ---- !ruby/struct:StructWithIvar +--- !ruby/struct:StructWithIvar foo: bar @bar: hello eoyml diff --git a/test/syck/test_yaml.rb b/test/syck/test_yaml.rb index b346de4bee..7edf79dbe6 100644 --- a/test/syck/test_yaml.rb +++ b/test/syck/test_yaml.rb @@ -505,7 +505,7 @@ EoY WHOIS lookup made at 11:56:46 19-Mar-2010 --- +-- This WHOIS information is provided for free by Nominet UK the central registry for .uk domain names. This information and the .uk WHOIS are: @@ -517,7 +517,7 @@ includes restrictions on: (A) use of the data for advertising, or its repackaging, recompilation, redistribution or reuse (B) obscuring, removing or hiding any or all of this notice and (C) exceeding query rate or volume limits. The data is provided on an 'as-is' basis and may lag behind the -register. Access may be withdrawn or restricted at any time. +register. Access may be withdrawn or restricted at any time. EoY end diff --git a/test/test_pstore.rb b/test/test_pstore.rb index b6f79251da..b5deb9f359 100644 --- a/test/test_pstore.rb +++ b/test/test_pstore.rb @@ -100,7 +100,7 @@ class PStoreTest < Test::Unit::TestCase File.unlink("pstore.tmp2.#{Process.pid}") rescue nil end end - + def test_nested_transaction_raises_error assert_raise(PStore::Error) do @pstore.transaction { @pstore.transaction { } } diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb index 9c1818fac2..b0ffe0866d 100644 --- a/test/thread/test_queue.rb +++ b/test/thread/test_queue.rb @@ -28,7 +28,7 @@ class TestQueue < Test::Unit::TestCase num_objects.times { from_workers.pop } } }.join - + num_threads.times { to_workers.push nil } workers.each { |t| t.join } diff --git a/test/webrick/test_cookie.rb b/test/webrick/test_cookie.rb index 1275dc8eff..48f0235aeb 100644 --- a/test/webrick/test_cookie.rb +++ b/test/webrick/test_cookie.rb @@ -56,7 +56,7 @@ class TestWEBrickCookie < Test::Unit::TestCase def test_parse_non_whitespace data = [ - '$Version="1";', + '$Version="1";', 'Customer="WILE_E_COYOTE";$Path="/acme";', 'Part_Number="Rocket_Launcher_0001";$Path="/acme";', 'Shipping="FedEx";$Path="/acme"' diff --git a/test/webrick/test_httprequest.rb b/test/webrick/test_httprequest.rb index 0f411d9859..2d96c2fcb0 100644 --- a/test/webrick/test_httprequest.rb +++ b/test/webrick/test_httprequest.rb @@ -309,7 +309,7 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase msg = <<-_end_of_message_ POST /path HTTP/1.1 Expect: 100-continue - + _end_of_message_ msg.gsub!(/^ {6}/, "") req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP) @@ -325,7 +325,7 @@ class TestWEBrickHTTPRequest < Test::Unit::TestCase def test_continue_not_sent msg = <<-_end_of_message_ POST /path HTTP/1.1 - + _end_of_message_ msg.gsub!(/^ {6}/, "") req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP) diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb index aa6504059f..2b34d273e2 100644 --- a/test/win32ole/test_win32ole_variant.rb +++ b/test/win32ole/test_win32ole_variant.rb @@ -383,7 +383,7 @@ if defined?(WIN32OLE_VARIANT) end # this test failed because of VariantTimeToSystemTime - # and SystemTimeToVariantTime API ignores wMilliseconds + # and SystemTimeToVariantTime API ignores wMilliseconds # member of SYSTEMTIME struct. # # def test_conversion_time_nsec2date -- cgit v1.2.3