Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

Commit

Permalink
Added test for deep hash with rockets
Browse files Browse the repository at this point in the history
  • Loading branch information
turboladen committed Apr 9, 2012
1 parent 130c72f commit 4b29680
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
Expand Up @@ -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_lonely_braces_as_t_string |
| indent/ok/multi_line_braces_embedded_arrays | | indent/ok/multi_line_braces_embedded_arrays |
| indent/ok/braces_combo | | indent/ok/braces_combo |
| indent/ok/deep_hash_with_rockets |


@single_line @brackets @single_line @brackets
Scenarios: Good single-line bracket uses Scenarios: Good single-line bracket uses
Expand Down
46 changes: 30 additions & 16 deletions features/support/file_cases/indentation_cases.rb
Expand Up @@ -357,51 +357,65 @@ def a_method
end} end}


INDENT_OK[:loop_with_braces] = INDENT_OK[:loop_with_braces] =
%Q{loop { %Q<loop {
puts 'stuff' puts 'stuff'
}} }>


#----------- Braces ----------# #----------- Braces ----------#
INDENT_OK[:single_line_braces] = INDENT_OK[:single_line_braces] =
%Q{{ one: 1, two: 2 }} %Q<{ one: 1, two: 2 }>


INDENT_OK[:single_line_braces_as_t_string] = 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] = INDENT_OK[:multi_line_braces] =
%Q{{ one: 1, %Q<{ one: 1,
two: 2 }} two: 2 }>


INDENT_OK[:multi_line_braces_as_t_string] = INDENT_OK[:multi_line_braces_as_t_string] =
%Q{%Q{this is a t string! %Q<%Q{this is a t string!
suckaaaaaa!}} suckaaaaaa!}>


# For some reason, Ruby doesn't like '%Q<> here. Using [] instead.
INDENT_OK[:multi_line_lonely_braces] = INDENT_OK[:multi_line_lonely_braces] =
%Q{{ %Q[{
:one => 'one', :two => 'two', :one => 'one', :two => 'two',
:three => 'three' :three => 'three'
}} }]


INDENT_OK[:multi_line_lonely_braces_as_t_string] = INDENT_OK[:multi_line_lonely_braces_as_t_string] =
%Q{%Q{ %Q<%Q{
this is a t string! this is a t string!
suckaaaaaa! suckaaaaaa!
}} }>


INDENT_OK[:multi_line_braces_embedded_arrays] = INDENT_OK[:multi_line_braces_embedded_arrays] =
%Q{{ %Q[{
:one => ['one', 17, {}], :two => ['two'], :one => ['one', 17, {}], :two => ['two'],
:three => 'three' :three => 'three'
}} }]

INDENT_OK[:braces_combo] = INDENT_OK[:braces_combo] =
%Q{{ three: 3 } %Q<{ three: 3 }
{ {
three: 3 } three: 3 }
{ 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 ----------# #----------- Brackets ----------#
INDENT_OK[:single_line_brackets] = INDENT_OK[:single_line_brackets] =
Expand Down

0 comments on commit 4b29680

Please sign in to comment.