From 3a96cc957dbd97c6ffeaea42f738e7c35b4acbc7 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 9 Mar 2015 13:08:33 +0000 Subject: Avoid "Array.new" and "Hash.new" Instead use {} + (). --- t/test-custodian-parser.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't/test-custodian-parser.rb') diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb index bd6a933..5822ecd 100755 --- a/t/test-custodian-parser.rb +++ b/t/test-custodian-parser.rb @@ -93,12 +93,12 @@ class TestCustodianParser < Test::Unit::TestCase # parser = Custodian::Parser.new() # 2.a. Comment lines return nil. - tmp = Array.new() + tmp = [] tmp.push( "# This is a comment.." ) assert( parser.parse_lines( tmp ).nil? ) # 2.b. Adding a test will return an array of test-objects. - tmp = Array.new() + tmp = [] tmp.push( "smtp.bytemark.co.uk must run ssh on 22 otherwise 'oops'." ); ret = parser.parse_lines( tmp ) assert( ret.kind_of? Array ); @@ -171,7 +171,7 @@ EOF # # Input text # - text = Array.new() + text = [] text.push( "FOO is kvm1.vm.bytemark.co.uk." ); text.push( "FOO2 is kvm2.vm.bytemark.co.uk." ); @@ -202,7 +202,7 @@ EOF # # Input text to parse. # - text = Array.new() + text = [] text.push( "FOO is kvm1.vm.bytemark.co.uk." ); text.push( "FOO is kvm2.vm.bytemark.co.uk." ); -- cgit v1.2.1