tailor 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +30 -28
  3. data/History.md +257 -0
  4. data/README.md +486 -0
  5. data/Rakefile +1 -9
  6. data/lib/ext/string_ext.rb +1 -1
  7. data/lib/tailor/cli.rb +3 -1
  8. data/lib/tailor/cli/options.rb +59 -39
  9. data/lib/tailor/configuration.rb +8 -5
  10. data/lib/tailor/configuration/file_set.rb +1 -3
  11. data/lib/tailor/configuration/style.rb +2 -0
  12. data/lib/tailor/critic.rb +2 -2
  13. data/lib/tailor/formatters/text.rb +17 -16
  14. data/lib/tailor/lexed_line.rb +2 -4
  15. data/lib/tailor/lexer.rb +9 -9
  16. data/lib/tailor/lexer/lexer_constants.rb +32 -32
  17. data/lib/tailor/lexer/token.rb +8 -10
  18. data/lib/tailor/logger.rb +1 -1
  19. data/lib/tailor/problem.rb +4 -1
  20. data/lib/tailor/rake_task.rb +4 -1
  21. data/lib/tailor/reporter.rb +3 -3
  22. data/lib/tailor/ruler.rb +2 -2
  23. data/lib/tailor/rulers/allow_camel_case_methods_ruler.rb +2 -2
  24. data/lib/tailor/rulers/allow_hard_tabs_ruler.rb +1 -1
  25. data/lib/tailor/rulers/allow_invalid_ruby_ruler.rb +1 -1
  26. data/lib/tailor/rulers/allow_screaming_snake_case_classes_ruler.rb +2 -2
  27. data/lib/tailor/rulers/indentation_spaces_ruler.rb +24 -22
  28. data/lib/tailor/rulers/indentation_spaces_ruler/indentation_manager.rb +13 -13
  29. data/lib/tailor/rulers/max_code_lines_in_class_ruler.rb +2 -2
  30. data/lib/tailor/rulers/max_code_lines_in_method_ruler.rb +2 -2
  31. data/lib/tailor/rulers/spaces_after_comma_ruler.rb +6 -6
  32. data/lib/tailor/rulers/spaces_after_conditional_ruler.rb +48 -0
  33. data/lib/tailor/rulers/spaces_after_lbrace_ruler.rb +8 -8
  34. data/lib/tailor/rulers/spaces_after_lbracket_ruler.rb +6 -6
  35. data/lib/tailor/rulers/spaces_after_lparen_ruler.rb +6 -6
  36. data/lib/tailor/rulers/spaces_before_comma_ruler.rb +2 -2
  37. data/lib/tailor/rulers/spaces_before_lbrace_ruler.rb +4 -4
  38. data/lib/tailor/rulers/spaces_before_rbrace_ruler.rb +9 -9
  39. data/lib/tailor/rulers/spaces_before_rbracket_ruler.rb +6 -6
  40. data/lib/tailor/rulers/spaces_before_rparen_ruler.rb +6 -6
  41. data/lib/tailor/rulers/spaces_in_empty_braces_ruler.rb +1 -1
  42. data/lib/tailor/rulers/trailing_newlines_ruler.rb +2 -2
  43. data/lib/tailor/tailorrc.erb +1 -1
  44. data/lib/tailor/version.rb +1 -1
  45. data/spec/functional/conditional_spacing_spec.rb +149 -0
  46. data/spec/functional/configuration_spec.rb +36 -26
  47. data/spec/functional/horizontal_spacing/braces_spec.rb +1 -1
  48. data/spec/functional/horizontal_spacing/brackets_spec.rb +14 -14
  49. data/spec/functional/horizontal_spacing/comma_spacing_spec.rb +8 -8
  50. data/spec/functional/horizontal_spacing/hard_tabs_spec.rb +13 -13
  51. data/spec/functional/horizontal_spacing/long_lines_spec.rb +6 -6
  52. data/spec/functional/horizontal_spacing/long_methods_spec.rb +55 -0
  53. data/spec/functional/horizontal_spacing/parens_spec.rb +17 -17
  54. data/spec/functional/horizontal_spacing/trailing_whitespace_spec.rb +8 -8
  55. data/spec/functional/horizontal_spacing_spec.rb +11 -11
  56. data/spec/functional/indentation_spacing/bad_indentation_spec.rb +83 -83
  57. data/spec/functional/indentation_spacing_spec.rb +10 -10
  58. data/spec/functional/naming/camel_case_methods_spec.rb +6 -6
  59. data/spec/functional/naming/screaming_snake_case_classes_spec.rb +10 -10
  60. data/spec/functional/naming_spec.rb +3 -3
  61. data/spec/functional/vertical_spacing/class_length_spec.rb +6 -6
  62. data/spec/functional/vertical_spacing/method_length_spec.rb +6 -6
  63. data/spec/functional/vertical_spacing_spec.rb +3 -3
  64. data/spec/support/conditional_spacing_cases.rb +37 -0
  65. data/spec/support/good_indentation_cases.rb +1 -1
  66. data/spec/unit/tailor/cli/options_spec.rb +50 -0
  67. data/spec/unit/tailor/cli_spec.rb +3 -3
  68. data/spec/unit/tailor/composite_observable_spec.rb +8 -8
  69. data/spec/unit/tailor/configuration/file_set_spec.rb +2 -2
  70. data/spec/unit/tailor/configuration/style_spec.rb +30 -29
  71. data/spec/unit/tailor/configuration_spec.rb +39 -24
  72. data/spec/unit/tailor/critic_spec.rb +18 -17
  73. data/spec/unit/tailor/formatter_spec.rb +15 -15
  74. data/spec/unit/tailor/formatters/yaml_spec.rb +1 -1
  75. data/spec/unit/tailor/lexed_line_spec.rb +258 -258
  76. data/spec/unit/tailor/lexer/token_spec.rb +11 -11
  77. data/spec/unit/tailor/lexer_spec.rb +35 -35
  78. data/spec/unit/tailor/problem_spec.rb +13 -13
  79. data/spec/unit/tailor/reporter_spec.rb +19 -18
  80. data/spec/unit/tailor/ruler_spec.rb +15 -15
  81. data/spec/unit/tailor/rulers/indentation_spaces_ruler/indentation_manager_spec.rb +72 -72
  82. data/spec/unit/tailor/rulers/indentation_spaces_ruler_spec.rb +32 -32
  83. data/spec/unit/tailor/rulers/spaces_after_comma_ruler_spec.rb +8 -8
  84. data/spec/unit/tailor/rulers/spaces_after_lbrace_ruler_spec.rb +36 -36
  85. data/spec/unit/tailor/rulers/spaces_before_lbrace_ruler_spec.rb +14 -14
  86. data/spec/unit/tailor/rulers/spaces_before_rbrace_ruler_spec.rb +14 -14
  87. data/spec/unit/tailor/rulers_spec.rb +2 -2
  88. data/spec/unit/tailor/version_spec.rb +1 -1
  89. data/spec/unit/tailor_spec.rb +4 -4
  90. data/tailor.gemspec +1 -1
  91. metadata +16 -9
  92. data/History.rdoc +0 -189
  93. data/README.rdoc +0 -422
  94. data/spec/unit/tailor/options_spec.rb +0 -6
@@ -1,10 +1,10 @@
1
- require_relative '../../spec_helper'
1
+ require 'spec_helper'
2
2
  require_relative '../../support/bad_indentation_cases'
3
3
  require 'tailor/critic'
4
4
  require 'tailor/configuration/style'
5
5
 
6
6
 
7
- describe "Detection of method length" do
7
+ describe 'Detection of method length' do
8
8
  before do
9
9
  Tailor::Logger.stub(:log)
10
10
  FakeFS.activate!
@@ -26,144 +26,144 @@ describe "Detection of method length" do
26
26
  style
27
27
  end
28
28
 
29
- context "simple classes" do
30
- context "empty with an indented end" do
29
+ context 'simple classes' do
30
+ context 'empty with an indented end' do
31
31
  let(:file_name) { 'class_indented_end' }
32
32
  specify { critic.problems[file_name].size.should be 1 }
33
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
33
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
34
34
  specify { critic.problems[file_name].first[:line].should be 2 }
35
35
  specify { critic.problems[file_name].first[:column].should be 1 }
36
36
  specify { critic.problems[file_name].first[:level].should be :error }
37
37
  end
38
38
 
39
- context "body extra indented" do
39
+ context 'body extra indented' do
40
40
  let(:file_name) { 'class_indented_single_statement' }
41
41
  specify { critic.problems[file_name].size.should be 1 }
42
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
42
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
43
43
  specify { critic.problems[file_name].first[:line].should be 2 }
44
44
  specify { critic.problems[file_name].first[:column].should be 3 }
45
45
  specify { critic.problems[file_name].first[:level].should be :error }
46
46
  end
47
47
 
48
- context "body extra indented, trailing comment" do
48
+ context 'body extra indented, trailing comment' do
49
49
  let(:file_name) { 'class_indented_single_statement_trailing_comment' }
50
50
  specify { critic.problems[file_name].size.should be 1 }
51
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
51
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
52
52
  specify { critic.problems[file_name].first[:line].should be 2 }
53
53
  specify { critic.problems[file_name].first[:column].should be 3 }
54
54
  specify { critic.problems[file_name].first[:level].should be :error }
55
55
  end
56
56
 
57
- context "body extra outdented" do
57
+ context 'body extra outdented' do
58
58
  let(:file_name) { 'class_outdented_single_statement' }
59
59
  specify { critic.problems[file_name].size.should be 1 }
60
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
60
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
61
61
  specify { critic.problems[file_name].first[:line].should be 2 }
62
62
  specify { critic.problems[file_name].first[:column].should be 1 }
63
63
  specify { critic.problems[file_name].first[:level].should be :error }
64
64
  end
65
65
  end
66
66
 
67
- context "simple methods" do
68
- context "empty with an indented end" do
67
+ context 'simple methods' do
68
+ context 'empty with an indented end' do
69
69
  let(:file_name) { 'def_indented_end' }
70
70
  specify { critic.problems[file_name].size.should be 1 }
71
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
71
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
72
72
  specify { critic.problems[file_name].first[:line].should be 2 }
73
73
  specify { critic.problems[file_name].first[:column].should be 1 }
74
74
  specify { critic.problems[file_name].first[:level].should be :error }
75
75
  end
76
76
 
77
- context "body and end extra indented" do
77
+ context 'body and end extra indented' do
78
78
  let(:file_name) { 'def_content_indented_end' }
79
79
  specify { critic.problems[file_name].size.should be 1 }
80
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
80
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
81
81
  specify { critic.problems[file_name].first[:line].should be 3 }
82
82
  specify { critic.problems[file_name].first[:column].should be 1 }
83
83
  specify { critic.problems[file_name].first[:level].should be :error }
84
84
  end
85
85
 
86
- context "in a class, end outdented" do
86
+ context 'in a class, end outdented' do
87
87
  let(:file_name) { 'class_def_content_outdented_end' }
88
88
  specify { critic.problems[file_name].size.should be 1 }
89
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
89
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
90
90
  specify { critic.problems[file_name].first[:line].should be 4 }
91
91
  specify { critic.problems[file_name].first[:column].should be 1 }
92
92
  specify { critic.problems[file_name].first[:level].should be :error }
93
93
  end
94
94
 
95
- context "in a class, body outdented" do
95
+ context 'in a class, body outdented' do
96
96
  let(:file_name) { 'class_def_outdented_content' }
97
97
  specify { critic.problems[file_name].size.should be 1 }
98
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
98
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
99
99
  specify { critic.problems[file_name].first[:line].should be 3 }
100
100
  specify { critic.problems[file_name].first[:column].should be 3 }
101
101
  specify { critic.problems[file_name].first[:level].should be :error }
102
102
  end
103
103
 
104
- context "class method outdented, in a class" do
104
+ context 'class method outdented, in a class' do
105
105
  let(:file_name) { 'class_method_def_using_self_outdented' }
106
106
  specify { critic.problems[file_name].size.should be 1 }
107
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
107
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
108
108
  specify { critic.problems[file_name].first[:line].should be 2 }
109
109
  specify { critic.problems[file_name].first[:column].should be 1 }
110
110
  specify { critic.problems[file_name].first[:level].should be :error }
111
111
  end
112
112
  end
113
113
 
114
- context "case statements" do
115
- context "case extra indented" do
114
+ context 'case statements' do
115
+ context 'case extra indented' do
116
116
  let(:file_name) { 'case_indented_whens_level' }
117
117
  specify { critic.problems[file_name].size.should be 1 }
118
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
118
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
119
119
  specify { critic.problems[file_name].first[:line].should be 2 }
120
120
  specify { critic.problems[file_name].first[:column].should be 3 }
121
121
  specify { critic.problems[file_name].first[:level].should be :error }
122
122
  end
123
123
 
124
- context "case extra indented, trailing comment" do
124
+ context 'case extra indented, trailing comment' do
125
125
  let(:file_name) { 'case_indented_whens_level_trailing_comment' }
126
126
  specify { critic.problems[file_name].size.should be 1 }
127
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
127
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
128
128
  specify { critic.problems[file_name].first[:line].should be 2 }
129
129
  specify { critic.problems[file_name].first[:column].should be 3 }
130
130
  specify { critic.problems[file_name].first[:level].should be :error }
131
131
  end
132
132
 
133
- context "case extra outdented" do
133
+ context 'case extra outdented' do
134
134
  let(:file_name) { 'case_outdented_whens_level' }
135
135
  specify { critic.problems[file_name].size.should be 1 }
136
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
136
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
137
137
  specify { critic.problems[file_name].first[:line].should be 2 }
138
138
  specify { critic.problems[file_name].first[:column].should be 1 }
139
139
  specify { critic.problems[file_name].first[:level].should be :error }
140
140
  end
141
141
 
142
- context "when extra intdented" do
142
+ context 'when extra intdented' do
143
143
  let(:file_name) { 'case_when_indented_whens_level' }
144
144
  specify { critic.problems[file_name].size.should be 1 }
145
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
145
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
146
146
  specify { critic.problems[file_name].first[:line].should be 3 }
147
147
  specify { critic.problems[file_name].first[:column].should be 3 }
148
148
  specify { critic.problems[file_name].first[:level].should be :error }
149
149
  end
150
150
 
151
- context "when extra outdented" do
151
+ context 'when extra outdented' do
152
152
  let(:file_name) { 'case_when_outdented_whens_level' }
153
153
  specify { critic.problems[file_name].size.should be 1 }
154
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
154
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
155
155
  specify { critic.problems[file_name].first[:line].should be 3 }
156
156
  specify { critic.problems[file_name].first[:column].should be 1 }
157
157
  specify { critic.problems[file_name].first[:level].should be :error }
158
158
  end
159
159
 
160
- context "case extra indented" do
161
- pending "Implementation of option to allow whens in"
160
+ context 'case extra indented' do
161
+ pending 'Implementation of option to allow whens in'
162
162
 
163
163
  =begin
164
164
  let(:file_name) { 'case_indented_whens_in' }
165
165
  specify { critic.problems[file_name].size.should be 1 }
166
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
166
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
167
167
  specify { critic.problems[file_name].first[:line].should be 2 }
168
168
  specify { critic.problems[file_name].first[:column].should be 1 }
169
169
  specify { critic.problems[file_name].first[:level].should be :error }
@@ -171,194 +171,194 @@ describe "Detection of method length" do
171
171
  end
172
172
  end
173
173
 
174
- context "while/do loops" do
175
- context "while/do indented" do
174
+ context 'while/do loops' do
175
+ context 'while/do indented' do
176
176
  let(:file_name) { 'while_do_indented' }
177
177
  specify { critic.problems[file_name].size.should be 1 }
178
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
178
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
179
179
  specify { critic.problems[file_name].first[:line].should be 1 }
180
180
  specify { critic.problems[file_name].first[:column].should be 1 }
181
181
  specify { critic.problems[file_name].first[:level].should be :error }
182
182
  end
183
183
 
184
- context "while/do outdented" do
184
+ context 'while/do outdented' do
185
185
  let(:file_name) { 'while_do_outdented' }
186
186
  specify { critic.problems[file_name].size.should be 1 }
187
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
187
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
188
188
  specify { critic.problems[file_name].first[:line].should be 2 }
189
189
  specify { critic.problems[file_name].first[:column].should be 1 }
190
190
  specify { critic.problems[file_name].first[:level].should be :error }
191
191
  end
192
192
 
193
- context "while/do content outdented" do
193
+ context 'while/do content outdented' do
194
194
  let(:file_name) { 'while_do_content_outdented' }
195
195
  specify { critic.problems[file_name].size.should be 1 }
196
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
196
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
197
197
  specify { critic.problems[file_name].first[:line].should be 3 }
198
198
  specify { critic.problems[file_name].first[:column].should be 3 }
199
199
  specify { critic.problems[file_name].first[:level].should be :error }
200
200
  end
201
201
 
202
- context "while/do content indented" do
202
+ context 'while/do content indented' do
203
203
  let(:file_name) { 'while_do_content_indented' }
204
204
  specify { critic.problems[file_name].size.should be 1 }
205
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
205
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
206
206
  specify { critic.problems[file_name].first[:line].should be 3 }
207
207
  specify { critic.problems[file_name].first[:column].should be 5 }
208
208
  specify { critic.problems[file_name].first[:level].should be :error }
209
209
  end
210
210
 
211
- context "another while/do indented" do
211
+ context 'another while/do indented' do
212
212
  let(:file_name) { 'while_do_indented2' }
213
213
  specify { critic.problems[file_name].size.should be 1 }
214
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
214
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
215
215
  specify { critic.problems[file_name].first[:line].should be 4 }
216
216
  specify { critic.problems[file_name].first[:column].should be 1 }
217
217
  specify { critic.problems[file_name].first[:level].should be :error }
218
218
  end
219
219
 
220
- context "another while/do indented, trailing comment" do
220
+ context 'another while/do indented, trailing comment' do
221
221
  let(:file_name) { 'while_do_indented2_trailing_comment' }
222
222
  specify { critic.problems[file_name].size.should be 1 }
223
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
223
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
224
224
  specify { critic.problems[file_name].first[:line].should be 4 }
225
225
  specify { critic.problems[file_name].first[:column].should be 1 }
226
226
  specify { critic.problems[file_name].first[:level].should be :error }
227
227
  end
228
228
  end
229
229
 
230
- context "until/do loops" do
231
- context "until indented" do
230
+ context 'until/do loops' do
231
+ context 'until indented' do
232
232
  let(:file_name) { 'until_do_indented' }
233
233
  specify { critic.problems[file_name].size.should be 1 }
234
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
234
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
235
235
  specify { critic.problems[file_name].first[:line].should be 4 }
236
236
  specify { critic.problems[file_name].first[:column].should be 1 }
237
237
  specify { critic.problems[file_name].first[:level].should be :error }
238
238
  end
239
239
  end
240
240
 
241
- context "for/do loops" do
242
- context "for indented" do
241
+ context 'for/do loops' do
242
+ context 'for indented' do
243
243
  let(:file_name) { 'for_do_indented' }
244
244
  specify { critic.problems[file_name].size.should be 1 }
245
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
245
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
246
246
  specify { critic.problems[file_name].first[:line].should be 1 }
247
247
  specify { critic.problems[file_name].first[:column].should be 1 }
248
248
  specify { critic.problems[file_name].first[:level].should be :error }
249
249
  end
250
250
  end
251
251
 
252
- context "loop/do loops" do
253
- context "loop indented" do
252
+ context 'loop/do loops' do
253
+ context 'loop indented' do
254
254
  let(:file_name) { 'loop_do_indented' }
255
255
  specify { critic.problems[file_name].size.should be 1 }
256
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
256
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
257
257
  specify { critic.problems[file_name].first[:line].should be 1 }
258
258
  specify { critic.problems[file_name].first[:column].should be 1 }
259
259
  specify { critic.problems[file_name].first[:level].should be :error }
260
260
  end
261
261
  end
262
262
 
263
- context "if statements" do
264
- context "first line extra indented" do
263
+ context 'if statements' do
264
+ context 'first line extra indented' do
265
265
  let(:file_name) { 'if_line_indented' }
266
266
  specify { critic.problems[file_name].size.should be 1 }
267
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
267
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
268
268
  specify { critic.problems[file_name].first[:line].should be 2 }
269
269
  specify { critic.problems[file_name].first[:column].should be 3 }
270
270
  specify { critic.problems[file_name].first[:level].should be :error }
271
271
  end
272
272
 
273
- context "first line extra indented, trailing comment" do
273
+ context 'first line extra indented, trailing comment' do
274
274
  let(:file_name) { 'if_line_indented_trailing_comment' }
275
275
  specify { critic.problems[file_name].size.should be 1 }
276
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
276
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
277
277
  specify { critic.problems[file_name].first[:line].should be 2 }
278
278
  specify { critic.problems[file_name].first[:column].should be 3 }
279
279
  specify { critic.problems[file_name].first[:level].should be :error }
280
280
  end
281
281
  end
282
282
 
283
- context "multi_line_tstring" do
283
+ context 'multi_line_tstring' do
284
284
  let(:file_name) { 'multi_line_tstring' }
285
285
  specify { critic.problems[file_name].size.should be 1 }
286
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
286
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
287
287
  specify { critic.problems[file_name].first[:line].should be 2 }
288
288
  specify { critic.problems[file_name].first[:column].should be 0 }
289
289
  specify { critic.problems[file_name].first[:level].should be :error }
290
290
  end
291
291
 
292
- context "operators" do
293
- context "multi-line &&, first line indented" do
292
+ context 'operators' do
293
+ context 'multi-line &&, first line indented' do
294
294
  let(:file_name) { 'multi_line_andop_first_line_indented' }
295
295
  specify { critic.problems[file_name].size.should be 1 }
296
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
296
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
297
297
  specify { critic.problems[file_name].first[:line].should be 2 }
298
298
  specify { critic.problems[file_name].first[:column].should be 3 }
299
299
  specify { critic.problems[file_name].first[:level].should be :error }
300
300
  end
301
301
 
302
- context "multi-line &&, first line indented, trailing comment" do
302
+ context 'multi-line &&, first line indented, trailing comment' do
303
303
  let(:file_name) { 'multi_line_andop_first_line_indented_trailing_comment' }
304
304
  specify { critic.problems[file_name].size.should be 1 }
305
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
305
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
306
306
  specify { critic.problems[file_name].first[:line].should be 2 }
307
307
  specify { critic.problems[file_name].first[:column].should be 3 }
308
308
  specify { critic.problems[file_name].first[:level].should be :error }
309
309
  end
310
310
 
311
- context "multi-line &&, second line indented" do
311
+ context 'multi-line &&, second line indented' do
312
312
  let(:file_name) { 'multi_line_andop_second_line_indented' }
313
313
  specify { critic.problems[file_name].size.should be 1 }
314
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
314
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
315
315
  specify { critic.problems[file_name].first[:line].should be 3 }
316
316
  specify { critic.problems[file_name].first[:column].should be 5 }
317
317
  specify { critic.problems[file_name].first[:level].should be :error }
318
318
  end
319
319
 
320
- context "multi-line string concat, second line outdented" do
320
+ context 'multi-line string concat, second line outdented' do
321
321
  let(:file_name) { 'multi_line_string_concat_with_plus_out' }
322
322
  specify { critic.problems[file_name].size.should be 1 }
323
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
323
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
324
324
  specify { critic.problems[file_name].first[:line].should be 2 }
325
325
  specify { critic.problems[file_name].first[:column].should be 1 }
326
326
  specify { critic.problems[file_name].first[:level].should be :error }
327
327
  end
328
328
  end
329
329
 
330
- context "combinations of stuff" do
331
- context "multi-line if with end in" do
330
+ context 'combinations of stuff' do
331
+ context 'multi-line if with end in' do
332
332
  let(:file_name) { 'multi_line_method_call_end_in' }
333
333
  specify { critic.problems[file_name].size.should be 1 }
334
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
334
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
335
335
  specify { critic.problems[file_name].first[:line].should be 5 }
336
336
  specify { critic.problems[file_name].first[:column].should be 3 }
337
337
  specify { critic.problems[file_name].first[:level].should be :error }
338
338
  end
339
339
 
340
- context "multi-line chained methods with 2nd line in" do
340
+ context 'multi-line chained methods with 2nd line in' do
341
341
  let(:file_name) { 'multi_line_method_call_ends_with_period_2nd_line_in' }
342
342
  specify { critic.problems[file_name].size.should be 1 }
343
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
343
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
344
344
  specify { critic.problems[file_name].first[:line].should be 4 }
345
345
  specify { critic.problems[file_name].first[:column].should be 5 }
346
346
  specify { critic.problems[file_name].first[:level].should be :error }
347
347
  end
348
348
 
349
- context "multi-line chained methods with 3rd line in" do
349
+ context 'multi-line chained methods with 3rd line in' do
350
350
  let(:file_name) { 'multi_line_method_call_ends_with_many_periods_last_in' }
351
351
  specify { critic.problems[file_name].size.should be 1 }
352
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
352
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
353
353
  specify { critic.problems[file_name].first[:line].should be 3 }
354
354
  specify { critic.problems[file_name].first[:column].should be 4 }
355
355
  specify { critic.problems[file_name].first[:level].should be :error }
356
356
  end
357
357
 
358
- context "multi-line chained methods with 3rd line in, trailing comment" do
358
+ context 'multi-line chained methods with 3rd line in, trailing comment' do
359
359
  let(:file_name) { 'multi_line_method_call_ends_with_many_periods_last_in_trailing_comment' }
360
360
  specify { critic.problems[file_name].size.should be 1 }
361
- specify { critic.problems[file_name].first[:type].should == "indentation_spaces" }
361
+ specify { critic.problems[file_name].first[:type].should == 'indentation_spaces' }
362
362
  specify { critic.problems[file_name].first[:line].should be 3 }
363
363
  specify { critic.problems[file_name].first[:column].should be 4 }
364
364
  specify { critic.problems[file_name].first[:level].should be :error }
@@ -1,10 +1,10 @@
1
- require_relative '../spec_helper'
1
+ require 'spec_helper'
2
2
  require_relative '../support/good_indentation_cases'
3
3
  require 'tailor/critic'
4
4
  require 'tailor/configuration/style'
5
5
 
6
6
 
7
- describe "Indentation spacing problem detection" do
7
+ describe 'Indentation spacing problem detection' do
8
8
  before do
9
9
  Tailor::Logger.stub(:log)
10
10
  FakeFS.activate!
@@ -30,13 +30,13 @@ describe "Indentation spacing problem detection" do
30
30
  File.open(file_name, 'w') { |f| f.write contents }
31
31
  end
32
32
 
33
- it "should be OK" do
33
+ it 'should be OK' do
34
34
  critic.check_file(file_name, style.to_hash)
35
35
  critic.problems.should == { file_name => [] }
36
36
  end
37
37
  end
38
38
 
39
- context "case statement with indented whens" do
39
+ context 'case statement with indented whens' do
40
40
  let(:file_name) { 'case_whens_in' }
41
41
 
42
42
  let(:contents) do
@@ -50,12 +50,12 @@ describe "Indentation spacing problem detection" do
50
50
  end}
51
51
  end
52
52
 
53
- it "is OK" do
54
- pending "Implementation of the option to allow for this"
53
+ it 'is OK' do
54
+ pending 'Implementation of the option to allow for this'
55
55
  end
56
56
  end
57
57
 
58
- context "method with rparen on following line" do
58
+ context 'method with rparen on following line' do
59
59
  let(:file_name) { 'method_closing_lonely_paren' }
60
60
 
61
61
  let(:contents) do
@@ -64,12 +64,12 @@ end}
64
64
  end}
65
65
  end
66
66
 
67
- it "is OK" do
67
+ it 'is OK' do
68
68
  pending
69
69
  end
70
70
  end
71
71
 
72
- context "lonely rparen and do on the same line" do
72
+ context 'lonely rparen and do on the same line' do
73
73
  let(:file_name) { 'rparen_and_do_same_line' }
74
74
 
75
75
  let(:contents) do
@@ -79,7 +79,7 @@ end}
79
79
  end}
80
80
  end
81
81
 
82
- it "is OK" do
82
+ it 'is OK' do
83
83
  pending
84
84
  end
85
85
  end