From 4b2968042d77f05533e6d514bc48410c1f04377a Mon Sep 17 00:00:00 2001 From: Steve Loveless Date: Mon, 9 Apr 2012 10:46:17 -0700 Subject: [PATCH] Added test for deep hash with rockets --- ...ood_files_with_no_trailing_newline.feature | 1 + .../support/file_cases/indentation_cases.rb | 46 ++++++++++++------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/features/indentation/good_files_with_no_trailing_newline.feature b/features/indentation/good_files_with_no_trailing_newline.feature index cd2e4d7..1326714 100644 --- a/features/indentation/good_files_with_no_trailing_newline.feature +++ b/features/indentation/good_files_with_no_trailing_newline.feature @@ -119,6 +119,7 @@ Feature: Indentation check on good files without trailing newlines | indent/ok/multi_line_lonely_braces_as_t_string | | indent/ok/multi_line_braces_embedded_arrays | | indent/ok/braces_combo | + | indent/ok/deep_hash_with_rockets | @single_line @brackets Scenarios: Good single-line bracket uses diff --git a/features/support/file_cases/indentation_cases.rb b/features/support/file_cases/indentation_cases.rb index 4c42a16..9c891bb 100644 --- a/features/support/file_cases/indentation_cases.rb +++ b/features/support/file_cases/indentation_cases.rb @@ -357,51 +357,65 @@ def a_method end} INDENT_OK[:loop_with_braces] = - %Q{loop { + %Q #----------- Braces ----------# INDENT_OK[:single_line_braces] = - %Q{{ one: 1, two: 2 }} + %Q<{ one: 1, two: 2 }> INDENT_OK[:single_line_braces_as_t_string] = - %Q{%Q{this is a t string!}} + %Q<%Q{this is a t string!}> INDENT_OK[:multi_line_braces] = - %Q{{ one: 1, - two: 2 }} + %Q<{ one: 1, + two: 2 }> INDENT_OK[:multi_line_braces_as_t_string] = - %Q{%Q{this is a t string! -suckaaaaaa!}} + %Q<%Q{this is a t string! +suckaaaaaa!}> +# For some reason, Ruby doesn't like '%Q<> here. Using [] instead. INDENT_OK[:multi_line_lonely_braces] = - %Q{{ + %Q[{ :one => 'one', :two => 'two', :three => 'three' -}} +}] INDENT_OK[:multi_line_lonely_braces_as_t_string] = - %Q{%Q{ + %Q<%Q{ this is a t string! suckaaaaaa! -}} +}> INDENT_OK[:multi_line_braces_embedded_arrays] = - %Q{{ + %Q[{ :one => ['one', 17, {}], :two => ['two'], :three => 'three' -}} +}] + INDENT_OK[:braces_combo] = - %Q{{ three: 3 } + %Q<{ three: 3 } { three: 3 } { three: 3 } { three: 3 -}} +}> + +INDENT_OK[:deep_hash_with_rockets] = + %Q[im_deep = + { "one" => + { "1" => + { "a" => "A", + "b" => "B", + "c" => "C" }, + "2" => + { "d" => "D", + "e" => "E", + "f" => "F" } } }] #----------- Brackets ----------# INDENT_OK[:single_line_brackets] =