From 287a34ae0dfc23e4158f67cb7783d239f202c368 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Mar 2009 03:56:38 +0000 Subject: * {ext,lib,test}/**/*.rb: removed trailing spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/yaml/test_yaml.rb | 60 ++++++++++++++++++++++----------------------- test/yaml/test_yamlstore.rb | 12 ++++----- 2 files changed, 36 insertions(+), 36 deletions(-) (limited to 'test/yaml') diff --git a/test/yaml/test_yaml.rb b/test/yaml/test_yaml.rb index 837f34722f..4f612ebaef 100644 --- a/test/yaml/test_yaml.rb +++ b/test/yaml/test_yaml.rb @@ -21,7 +21,7 @@ class YAML_Unit_Tests < Test::Unit::TestCase assert_equal( obj, YAML::load( obj.to_yaml ) ) assert_equal( obj, YAML::parse( obj.to_yaml ).transform ) assert_equal( obj, YAML::load( - obj.to_yaml( :UseVersion => true, :UseHeader => true, :SortKeys => true ) + obj.to_yaml( :UseVersion => true, :UseHeader => true, :SortKeys => true ) ) ) end @@ -133,7 +133,7 @@ EOY def test_spec_simple_map_with_nested_sequences # Simple mapping with nested sequences assert_to_yaml( - { 'american' => + { 'american' => [ 'Boston Red Sox', 'Detroit Tigers', 'New York Yankees' ], 'national' => [ 'New York Mets', 'Chicago Cubs', 'Atlanta Braves' ] }, <"EDI", "departure"=>"LAX", "fareref"=>"DOGMA", "currency"=>"GBP"}, {"arrival"=>"MEL", "departure"=>"SYD", "fareref"=>"MADF", "currency"=>"AUD"}, {"arrival"=>"MCO", "departure"=>"JFK", "fareref"=>"DFSF", "currency"=>"USD"}], < nil }, @@ -440,7 +440,7 @@ quoted: "\\ scalar.\\n" EOY ) - end + end def test_spec_type_int assert_parse_only( @@ -678,7 +678,7 @@ EOY def test_spec_force_implicit # Force implicit - assert_parse_only( + assert_parse_only( { 'integer' => 12, 'also int' => 12, 'string' => '12' }, < 8, 'color' => 'black' } ) when 1 - assert_equal( doc['bearing'].type_id, 'x-private:ball' ) + assert_equal( doc['bearing'].type_id, 'x-private:ball' ) assert_equal( doc['bearing'].transform.value, { 'material' => 'steel' } ) end doc_ct += 1 @@ -734,7 +734,7 @@ EOY def test_spec_override_anchor # Override anchor a001 = "The alias node below is a repeated use of this value.\n" - assert_parse_only( + assert_parse_only( { 'anchor' => 'This scalar has an anchor.', 'override' => a001, 'alias' => a001 }, < @@ -758,7 +758,7 @@ picture: !binary | Pz7Y6OjuDg4J+fn5OTk6enp 56enmleECcgggoBADs= -hmm: !somewhere.com,2002/type | +hmm: !somewhere.com,2002/type | family above is short for http://somewhere.com/type EOY @@ -843,7 +843,7 @@ EOY def test_spec_builtin_map # Assortment of mappings - assert_parse_only( + assert_parse_only( { 'empty' => {}, 'in-line' => { 'one' => 1, 'two' => 2 }, 'spanning' => { 'one' => 1, 'two' => 2 }, 'nested' => { 'first' => 'First entry', 'second' => @@ -945,9 +945,9 @@ EOY str1 = "This has one newline.\n" str2 = "This has no newline." str3 = "This has two newlines.\n\n" - assert_parse_only( - { 'clipped' => str1, 'same as "clipped" above' => str1, - 'stripped' => str2, 'same as "stripped" above' => str2, + assert_parse_only( + { 'clipped' => str1, 'same as "clipped" above' => str1, + 'stripped' => str2, 'same as "stripped" above' => str2, 'kept' => str3, 'same as "kept" above' => str3 }, <"a single quote ' must be escaped.", "second"=>"! : \\ etc. can be used freely.", "is same as"=>"this contains six spaces\nand one line break", "empty"=>"", "span"=>"this contains six spaces\nand one line break"}, < mktime( 2001, 12, 14, 21, 59, 43, ".10", "-05:00" ), - "canonical" => mktime( 2001, 12, 15, 2, 59, 43, ".10" ), - "date (noon UTC)" => Date.new( 2002, 12, 14), + { "space separated" => mktime( 2001, 12, 14, 21, 59, 43, ".10", "-05:00" ), + "canonical" => mktime( 2001, 12, 15, 2, 59, 43, ".10" ), + "date (noon UTC)" => Date.new( 2002, 12, 14), "valid iso8601" => mktime( 2001, 12, 14, 21, 59, 43, ".10", "-05:00" ) }, < arrow_gif, 'base64' => arrow_gif, + { 'canonical' => arrow_gif, 'base64' => arrow_gif, 'description' => "The binary value above is a tiny arrow encoded as a gif image.\n" }, < /a.b/, 'complex' => %r'\A"((?:[^"]|\")+)"', 'case-insensitive' => /George McFly/i }, < 2, :UseVersion => 0 ) - y.add( + y.add( { 'hi' => 'hello', 'map' => { 'good' => 'two' }, 'time' => Time.now, diff --git a/test/yaml/test_yamlstore.rb b/test/yaml/test_yamlstore.rb index 7a3d90469e..69302095e5 100644 --- a/test/yaml/test_yamlstore.rb +++ b/test/yaml/test_yamlstore.rb @@ -17,14 +17,14 @@ class YAMLStoreTest < Test::Unit::TestCase assert_nil @yamlstore[:bar] end end - + def test_opening_new_file_in_readwrite_mode_should_result_in_empty_values @yamlstore.transaction do assert_nil @yamlstore[:foo] assert_nil @yamlstore[:bar] end end - + def test_data_should_be_loaded_correctly_when_in_readonly_mode @yamlstore.transaction do @yamlstore[:foo] = "bar" @@ -33,7 +33,7 @@ class YAMLStoreTest < Test::Unit::TestCase assert_equal "bar", @yamlstore[:foo] end end - + def test_data_should_be_loaded_correctly_when_in_readwrite_mode @yamlstore.transaction do @yamlstore[:foo] = "bar" @@ -42,7 +42,7 @@ class YAMLStoreTest < Test::Unit::TestCase assert_equal "bar", @yamlstore[:foo] end end - + def test_changes_after_commit_are_discarded @yamlstore.transaction do @yamlstore[:foo] = "bar" @@ -53,7 +53,7 @@ class YAMLStoreTest < Test::Unit::TestCase assert_equal "bar", @yamlstore[:foo] end end - + def test_changes_are_not_written_on_abort @yamlstore.transaction do @yamlstore[:foo] = "bar" @@ -63,7 +63,7 @@ class YAMLStoreTest < Test::Unit::TestCase assert_nil @yamlstore[:foo] end end - + def test_writing_inside_readonly_transaction_raises_error assert_raise(PStore::Error) do @yamlstore.transaction(true) do -- cgit v1.2.3