tailor 1.4.0 → 1.4.1
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.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/Gemfile.lock +39 -31
- data/History.md +220 -207
- data/README.md +58 -45
- data/features/step_definitions/indentation_steps.rb +1 -1
- data/lib/tailor/reporter.rb +19 -7
- data/lib/tailor/rulers/spaces_before_lbrace_ruler.rb +0 -1
- data/lib/tailor/rulers/spaces_before_rbrace_ruler.rb +0 -1
- data/lib/tailor/rulers/spaces_in_empty_braces_ruler.rb +0 -1
- data/lib/tailor/version.rb +1 -1
- data/spec/functional/conditional_parentheses_spec.rb +1 -1
- data/spec/functional/conditional_spacing_spec.rb +1 -1
- data/spec/functional/configuration_spec.rb +61 -52
- data/spec/functional/horizontal_spacing/braces_spec.rb +134 -134
- data/spec/functional/horizontal_spacing/brackets_spec.rb +34 -36
- data/spec/functional/horizontal_spacing/comma_spacing_spec.rb +25 -27
- data/spec/functional/horizontal_spacing/hard_tabs_spec.rb +42 -42
- data/spec/functional/horizontal_spacing/long_lines_spec.rb +15 -17
- data/spec/functional/horizontal_spacing/long_methods_spec.rb +4 -4
- data/spec/functional/horizontal_spacing/parens_spec.rb +45 -45
- data/spec/functional/horizontal_spacing/trailing_whitespace_spec.rb +7 -8
- data/spec/functional/horizontal_spacing_spec.rb +10 -11
- data/spec/functional/indentation_spacing/argument_alignment_spec.rb +33 -62
- data/spec/functional/indentation_spacing/bad_indentation_spec.rb +176 -179
- data/spec/functional/indentation_spacing_spec.rb +13 -14
- data/spec/functional/naming/camel_case_methods_spec.rb +4 -6
- data/spec/functional/naming/screaming_snake_case_classes_spec.rb +28 -31
- data/spec/functional/naming_spec.rb +3 -3
- data/spec/functional/rake_task_spec.rb +9 -28
- data/spec/functional/string_interpolation_spec.rb +1 -1
- data/spec/functional/string_quoting_spec.rb +1 -1
- data/spec/functional/vertical_spacing/class_length_spec.rb +4 -6
- data/spec/functional/vertical_spacing/method_length_spec.rb +15 -17
- data/spec/functional/vertical_spacing_spec.rb +3 -3
- data/spec/spec_helper.rb +2 -0
- data/spec/support/argument_alignment_cases.rb +32 -32
- data/spec/support/conditional_parentheses_cases.rb +26 -26
- data/spec/support/good_indentation_cases.rb +205 -205
- data/spec/support/horizontal_spacing_cases.rb +53 -54
- data/spec/support/line_indentation_cases.rb +20 -20
- data/spec/support/naming_cases.rb +12 -12
- data/spec/support/string_interpolation_cases.rb +17 -17
- data/spec/support/string_quoting_cases.rb +12 -12
- data/spec/support/vertical_spacing_cases.rb +8 -8
- data/spec/unit/tailor/cli/options_spec.rb +20 -14
- data/spec/unit/tailor/cli_spec.rb +29 -43
- data/spec/unit/tailor/composite_observable_spec.rb +1 -1
- data/spec/unit/tailor/configuration/file_set_spec.rb +10 -11
- data/spec/unit/tailor/configuration/style_spec.rb +41 -42
- data/spec/unit/tailor/configuration_spec.rb +14 -12
- data/spec/unit/tailor/formatter_spec.rb +3 -3
- data/spec/unit/tailor/formatters/yaml_spec.rb +12 -13
- data/spec/unit/tailor/lexed_line_spec.rb +67 -69
- data/spec/unit/tailor/lexer/token_spec.rb +7 -7
- data/spec/unit/tailor/lexer_spec.rb +24 -24
- data/spec/unit/tailor/problem_spec.rb +12 -12
- data/spec/unit/tailor/reporter_spec.rb +8 -9
- data/spec/unit/tailor/ruler_spec.rb +10 -10
- data/spec/unit/tailor/rulers/indentation_spaces_ruler/indentation_manager_spec.rb +90 -86
- data/spec/unit/tailor/rulers/indentation_spaces_ruler_spec.rb +13 -13
- data/spec/unit/tailor/rulers/spaces_after_comma_ruler_spec.rb +4 -4
- data/spec/unit/tailor/rulers/spaces_after_lbrace_ruler_spec.rb +19 -19
- data/spec/unit/tailor/rulers/spaces_before_lbrace_ruler_spec.rb +6 -6
- data/spec/unit/tailor/rulers/spaces_before_rbrace_ruler_spec.rb +6 -6
- data/spec/unit/tailor/rulers_spec.rb +1 -1
- data/spec/unit/tailor/version_spec.rb +1 -2
- data/spec/unit/tailor_spec.rb +2 -2
- data/tailor.gemspec +3 -3
- metadata +20 -6
@@ -3,10 +3,9 @@ require_relative '../support/good_indentation_cases'
|
|
3
3
|
require 'tailor/critic'
|
4
4
|
require 'tailor/configuration/style'
|
5
5
|
|
6
|
-
|
7
6
|
describe 'Indentation spacing problem detection' do
|
8
7
|
before do
|
9
|
-
Tailor::Logger.
|
8
|
+
allow(Tailor::Logger).to receive(:log)
|
10
9
|
FakeFS.activate!
|
11
10
|
end
|
12
11
|
|
@@ -30,9 +29,9 @@ describe 'Indentation spacing problem detection' do
|
|
30
29
|
File.open(file_name, 'w') { |f| f.write contents }
|
31
30
|
end
|
32
31
|
|
33
|
-
it '
|
32
|
+
it 'is OK' do
|
34
33
|
critic.check_file(file_name, style.to_hash)
|
35
|
-
critic.problems.
|
34
|
+
expect(critic.problems).to eq(file_name => [])
|
36
35
|
end
|
37
36
|
end
|
38
37
|
|
@@ -40,18 +39,18 @@ describe 'Indentation spacing problem detection' do
|
|
40
39
|
let(:file_name) { 'case_whens_in' }
|
41
40
|
|
42
41
|
let(:contents) do
|
43
|
-
%
|
42
|
+
%(def my_method
|
44
43
|
case true
|
45
44
|
when true
|
46
45
|
puts "stuff"
|
47
46
|
when false
|
48
47
|
puts "blah blah"
|
49
48
|
end
|
50
|
-
end
|
49
|
+
end)
|
51
50
|
end
|
52
51
|
|
53
52
|
it 'is OK' do
|
54
|
-
|
53
|
+
skip 'Implementation of the option to allow for this'
|
55
54
|
end
|
56
55
|
end
|
57
56
|
|
@@ -59,13 +58,13 @@ end}
|
|
59
58
|
let(:file_name) { 'method_closing_lonely_paren' }
|
60
59
|
|
61
60
|
let(:contents) do
|
62
|
-
%
|
61
|
+
%{def your_thing(one
|
63
62
|
)
|
64
63
|
end}
|
65
64
|
end
|
66
65
|
|
67
66
|
it 'is OK' do
|
68
|
-
|
67
|
+
skip 'Implementation'
|
69
68
|
end
|
70
69
|
end
|
71
70
|
|
@@ -73,14 +72,14 @@ end}
|
|
73
72
|
let(:file_name) { 'rparen_and_do_same_line' }
|
74
73
|
|
75
74
|
let(:contents) do
|
76
|
-
%
|
75
|
+
%{opt.on('-c', '--config-file FILE',
|
77
76
|
"Use a specific config file.") do |config|
|
78
77
|
options.config_file = config
|
79
78
|
end}
|
80
79
|
end
|
81
80
|
|
82
81
|
it 'is OK' do
|
83
|
-
|
82
|
+
skip 'Implementation'
|
84
83
|
end
|
85
84
|
end
|
86
85
|
|
@@ -88,16 +87,16 @@ end}
|
|
88
87
|
let(:file_name) { 'block_chain' }
|
89
88
|
|
90
89
|
let(:contents) do
|
91
|
-
%
|
90
|
+
%({
|
92
91
|
a: 1
|
93
92
|
}.each do |k, v|
|
94
93
|
puts k, v
|
95
|
-
end
|
94
|
+
end)
|
96
95
|
end
|
97
96
|
|
98
97
|
it 'is OK' do
|
99
98
|
critic.check_file(file_name, style.to_hash)
|
100
|
-
critic.problems.
|
99
|
+
expect(critic.problems).to eq(file_name => [])
|
101
100
|
end
|
102
101
|
end
|
103
102
|
end
|
@@ -2,17 +2,15 @@ require 'spec_helper'
|
|
2
2
|
require 'tailor/critic'
|
3
3
|
require 'tailor/configuration/style'
|
4
4
|
|
5
|
-
|
6
5
|
CAMEL_CASE_METHODS = {}
|
7
6
|
|
8
7
|
CAMEL_CASE_METHODS['one_caps_camel_case_method'] =
|
9
|
-
%
|
10
|
-
end
|
8
|
+
%(def thingOne
|
9
|
+
end)
|
11
10
|
|
12
11
|
CAMEL_CASE_METHODS['one_caps_camel_case_method_trailing_comment'] =
|
13
|
-
%
|
14
|
-
end
|
15
|
-
|
12
|
+
%(def thingOne # comment
|
13
|
+
end)
|
16
14
|
|
17
15
|
describe 'Detection of camel case methods' do
|
18
16
|
before do
|
@@ -2,26 +2,23 @@ require 'spec_helper'
|
|
2
2
|
require 'tailor/critic'
|
3
3
|
require 'tailor/configuration/style'
|
4
4
|
|
5
|
-
|
6
5
|
SCREAMING_SNAKE_CASE_CLASSES = {}
|
7
6
|
|
8
7
|
SCREAMING_SNAKE_CASE_CLASSES['one_screaming_snake_case_class'] =
|
9
|
-
%
|
10
|
-
end
|
8
|
+
%(class Thing_One
|
9
|
+
end)
|
11
10
|
|
12
11
|
SCREAMING_SNAKE_CASE_CLASSES['one_screaming_snake_case_module'] =
|
13
|
-
%
|
14
|
-
end
|
12
|
+
%(module Thing_One
|
13
|
+
end)
|
15
14
|
|
16
15
|
SCREAMING_SNAKE_CASE_CLASSES['double_screaming_snake_case_class'] =
|
17
|
-
%
|
18
|
-
end
|
16
|
+
%(class Thing_One_Again
|
17
|
+
end)
|
19
18
|
|
20
19
|
SCREAMING_SNAKE_CASE_CLASSES['double_screaming_snake_case_module'] =
|
21
|
-
%
|
22
|
-
end
|
23
|
-
|
24
|
-
|
20
|
+
%(module Thing_One_Again
|
21
|
+
end)
|
25
22
|
|
26
23
|
describe 'Detection of camel case methods' do
|
27
24
|
before do
|
@@ -47,37 +44,37 @@ describe 'Detection of camel case methods' do
|
|
47
44
|
|
48
45
|
context 'standard screaming snake case class' do
|
49
46
|
let(:file_name) { 'one_screaming_snake_case_class' }
|
50
|
-
specify { critic.problems[file_name].size.
|
51
|
-
specify { critic.problems[file_name].first[:type].
|
52
|
-
specify { critic.problems[file_name].first[:line].
|
53
|
-
specify { critic.problems[file_name].first[:column].
|
54
|
-
specify { critic.problems[file_name].first[:level].
|
47
|
+
specify { expect(critic.problems[file_name].size).to eq 1 }
|
48
|
+
specify { expect(critic.problems[file_name].first[:type]).to eq 'allow_screaming_snake_case_classes' }
|
49
|
+
specify { expect(critic.problems[file_name].first[:line]).to eq 1 }
|
50
|
+
specify { expect(critic.problems[file_name].first[:column]).to eq 6 }
|
51
|
+
specify { expect(critic.problems[file_name].first[:level]).to eq :error }
|
55
52
|
end
|
56
53
|
|
57
54
|
context 'standard screaming snake case module' do
|
58
55
|
let(:file_name) { 'one_screaming_snake_case_module' }
|
59
|
-
specify { critic.problems[file_name].size.
|
60
|
-
specify { critic.problems[file_name].first[:type].
|
61
|
-
specify { critic.problems[file_name].first[:line].
|
62
|
-
specify { critic.problems[file_name].first[:column].
|
63
|
-
specify { critic.problems[file_name].first[:level].
|
56
|
+
specify { expect(critic.problems[file_name].size).to eq 1 }
|
57
|
+
specify { expect(critic.problems[file_name].first[:type]).to eq 'allow_screaming_snake_case_classes' }
|
58
|
+
specify { expect(critic.problems[file_name].first[:line]).to eq 1 }
|
59
|
+
specify { expect(critic.problems[file_name].first[:column]).to eq 7 }
|
60
|
+
specify { expect(critic.problems[file_name].first[:level]).to eq :error }
|
64
61
|
end
|
65
62
|
|
66
63
|
context 'double screaming snake case class' do
|
67
64
|
let(:file_name) { 'double_screaming_snake_case_class' }
|
68
|
-
specify { critic.problems[file_name].size.
|
69
|
-
specify { critic.problems[file_name].first[:type].
|
70
|
-
specify { critic.problems[file_name].first[:line].
|
71
|
-
specify { critic.problems[file_name].first[:column].
|
72
|
-
specify { critic.problems[file_name].first[:level].
|
65
|
+
specify { expect(critic.problems[file_name].size).to eq 1 }
|
66
|
+
specify { expect(critic.problems[file_name].first[:type]).to eq 'allow_screaming_snake_case_classes' }
|
67
|
+
specify { expect(critic.problems[file_name].first[:line]).to eq 1 }
|
68
|
+
specify { expect(critic.problems[file_name].first[:column]).to eq 6 }
|
69
|
+
specify { expect(critic.problems[file_name].first[:level]).to eq :error }
|
73
70
|
end
|
74
71
|
|
75
72
|
context 'double screaming snake case module' do
|
76
73
|
let(:file_name) { 'double_screaming_snake_case_module' }
|
77
|
-
specify { critic.problems[file_name].size.
|
78
|
-
specify { critic.problems[file_name].first[:type].
|
79
|
-
specify { critic.problems[file_name].first[:line].
|
80
|
-
specify { critic.problems[file_name].first[:column].
|
81
|
-
specify { critic.problems[file_name].first[:level].
|
74
|
+
specify { expect(critic.problems[file_name].size).to eq 1 }
|
75
|
+
specify { expect(critic.problems[file_name].first[:type]).to eq 'allow_screaming_snake_case_classes' }
|
76
|
+
specify { expect(critic.problems[file_name].first[:line]).to eq 1 }
|
77
|
+
specify { expect(critic.problems[file_name].first[:column]).to eq 7 }
|
78
|
+
specify { expect(critic.problems[file_name].first[:level]).to eq :error }
|
82
79
|
end
|
83
80
|
end
|
@@ -6,7 +6,7 @@ require 'tailor/configuration/style'
|
|
6
6
|
|
7
7
|
describe 'Naming problem detection' do
|
8
8
|
before do
|
9
|
-
Tailor::Logger.
|
9
|
+
allow(Tailor::Logger).to receive(:log)
|
10
10
|
FakeFS.activate!
|
11
11
|
end
|
12
12
|
|
@@ -28,9 +28,9 @@ describe 'Naming problem detection' do
|
|
28
28
|
File.open(file_name, 'w') { |f| f.write contents }
|
29
29
|
end
|
30
30
|
|
31
|
-
it '
|
31
|
+
it 'is OK' do
|
32
32
|
critic.check_file(file_name, style.to_hash)
|
33
|
-
critic.problems.
|
33
|
+
expect(critic.problems).to eq(file_name => [])
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'tailor/rake_task'
|
3
3
|
|
4
|
-
|
5
4
|
describe Tailor::RakeTask do
|
6
5
|
let(:rake) do
|
7
6
|
Rake::Application.new
|
@@ -22,10 +21,7 @@ describe Tailor::RakeTask do
|
|
22
21
|
|
23
22
|
it 'finds problems' do
|
24
23
|
subject
|
25
|
-
|
26
|
-
expect {
|
27
|
-
rake['tailor'].invoke
|
28
|
-
}.to raise_error SystemExit
|
24
|
+
expect { rake['tailor'].invoke }.to raise_error SystemExit
|
29
25
|
end
|
30
26
|
end
|
31
27
|
|
@@ -38,10 +34,7 @@ describe Tailor::RakeTask do
|
|
38
34
|
|
39
35
|
it 'does not find problems' do
|
40
36
|
subject
|
41
|
-
|
42
|
-
expect {
|
43
|
-
rake['tailor'].invoke
|
44
|
-
}.to_not raise_error
|
37
|
+
expect { rake['tailor'].invoke }.to_not raise_error
|
45
38
|
end
|
46
39
|
end
|
47
40
|
end
|
@@ -57,10 +50,7 @@ describe Tailor::RakeTask do
|
|
57
50
|
|
58
51
|
it 'runs the task' do
|
59
52
|
subject
|
60
|
-
|
61
|
-
expect {
|
62
|
-
rake[task_name].invoke
|
63
|
-
}.to_not raise_error RuntimeError, "Don't know how to build task '#{task_name}''"
|
53
|
+
expect { rake[task_name].invoke }.to raise_exception SystemExit
|
64
54
|
end
|
65
55
|
end
|
66
56
|
|
@@ -68,16 +58,13 @@ describe Tailor::RakeTask do
|
|
68
58
|
subject do
|
69
59
|
Tailor::RakeTask.new do |t|
|
70
60
|
t.config_file = File.expand_path 'spec/support/rake_task_config_problems.rb'
|
71
|
-
t.tailor_opts = %w
|
61
|
+
t.tailor_opts = %w(--max-line-length=1000)
|
72
62
|
end
|
73
63
|
end
|
74
64
|
|
75
65
|
it 'uses the options from the rake task' do
|
76
66
|
subject
|
77
|
-
|
78
|
-
expect {
|
79
|
-
rake['tailor'].invoke
|
80
|
-
}.to_not raise_error
|
67
|
+
expect { rake['tailor'].invoke }.to_not raise_error
|
81
68
|
end
|
82
69
|
end
|
83
70
|
|
@@ -89,11 +76,8 @@ describe Tailor::RakeTask do
|
|
89
76
|
before do
|
90
77
|
require 'fileutils'
|
91
78
|
|
92
|
-
unless File.
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
File.directory?(test_dir).should be_true
|
79
|
+
FileUtils.mkdir(test_dir) unless File.exist?(test_dir)
|
80
|
+
expect(File.directory?(test_dir)).to eq true
|
97
81
|
|
98
82
|
File.open(test_dir + '/test.rb', 'w') do |f|
|
99
83
|
f.write <<-CONTENTS
|
@@ -101,7 +85,7 @@ puts 'I no have end quote
|
|
101
85
|
CONTENTS
|
102
86
|
end
|
103
87
|
|
104
|
-
File.
|
88
|
+
expect(File.exist?(test_dir + '/test.rb')).to eq true
|
105
89
|
end
|
106
90
|
|
107
91
|
after do
|
@@ -120,10 +104,7 @@ puts 'I no have end quote
|
|
120
104
|
|
121
105
|
it 'uses the options from the rake task' do
|
122
106
|
subject
|
123
|
-
|
124
|
-
expect {
|
125
|
-
rake['tailor'].invoke
|
126
|
-
}.to raise_error
|
107
|
+
expect { rake['tailor'].invoke }.to raise_error
|
127
108
|
end
|
128
109
|
end
|
129
110
|
end
|
@@ -2,27 +2,25 @@ require 'spec_helper'
|
|
2
2
|
require 'tailor/critic'
|
3
3
|
require 'tailor/configuration/style'
|
4
4
|
|
5
|
-
|
6
5
|
CLASS_LENGTH = {}
|
7
6
|
CLASS_LENGTH['class_too_long'] =
|
8
|
-
%
|
7
|
+
%(class Party
|
9
8
|
include Clowns
|
10
9
|
include Pizza
|
11
10
|
|
12
11
|
def barrel_roll
|
13
12
|
puts 'DOABARRELROLL!'
|
14
13
|
end
|
15
|
-
end
|
14
|
+
end)
|
16
15
|
|
17
16
|
CLASS_LENGTH['parent_class_too_long'] =
|
18
|
-
%
|
17
|
+
%(class Party
|
19
18
|
|
20
19
|
class Pizza
|
21
20
|
include Cheese
|
22
21
|
include Yumminess
|
23
22
|
end
|
24
|
-
end
|
25
|
-
|
23
|
+
end)
|
26
24
|
|
27
25
|
describe 'Detection of class length' do
|
28
26
|
before do
|
@@ -2,25 +2,23 @@ require 'spec_helper'
|
|
2
2
|
require 'tailor/critic'
|
3
3
|
require 'tailor/configuration/style'
|
4
4
|
|
5
|
-
|
6
5
|
METHOD_LENGTH = {}
|
7
6
|
METHOD_LENGTH['method_too_long'] =
|
8
|
-
%
|
7
|
+
%(def thing
|
9
8
|
puts
|
10
9
|
puts
|
11
|
-
end
|
10
|
+
end)
|
12
11
|
|
13
12
|
METHOD_LENGTH['parent_method_too_long'] =
|
14
|
-
%
|
13
|
+
%(def thing
|
15
14
|
puts
|
16
15
|
def inner_thing; print '1'; end
|
17
16
|
puts
|
18
|
-
end
|
19
|
-
|
17
|
+
end)
|
20
18
|
|
21
19
|
describe 'Detection of method length' do
|
22
20
|
before do
|
23
|
-
Tailor::Logger.
|
21
|
+
allow(Tailor::Logger).to receive(:log)
|
24
22
|
FakeFS.activate!
|
25
23
|
File.open(file_name, 'w') { |f| f.write contents }
|
26
24
|
critic.check_file(file_name, style.to_hash)
|
@@ -43,19 +41,19 @@ describe 'Detection of method length' do
|
|
43
41
|
|
44
42
|
context 'single class too long' do
|
45
43
|
let(:file_name) { 'method_too_long' }
|
46
|
-
specify { critic.problems[file_name].size.
|
47
|
-
specify { critic.problems[file_name].first[:type].
|
48
|
-
specify { critic.problems[file_name].first[:line].
|
49
|
-
specify { critic.problems[file_name].first[:column].
|
50
|
-
specify { critic.problems[file_name].first[:level].
|
44
|
+
specify { expect(critic.problems[file_name].size).to eq 1 }
|
45
|
+
specify { expect(critic.problems[file_name].first[:type]).to eq 'max_code_lines_in_method' }
|
46
|
+
specify { expect(critic.problems[file_name].first[:line]).to eq 1 }
|
47
|
+
specify { expect(critic.problems[file_name].first[:column]).to eq 0 }
|
48
|
+
specify { expect(critic.problems[file_name].first[:level]).to eq :error }
|
51
49
|
end
|
52
50
|
|
53
51
|
context 'method in a method' do
|
54
52
|
let(:file_name) { 'method_too_long' }
|
55
|
-
specify { critic.problems[file_name].size.
|
56
|
-
specify { critic.problems[file_name].first[:type].
|
57
|
-
specify { critic.problems[file_name].first[:line].
|
58
|
-
specify { critic.problems[file_name].first[:column].
|
59
|
-
specify { critic.problems[file_name].first[:level].
|
53
|
+
specify { expect(critic.problems[file_name].size).to eq 1 }
|
54
|
+
specify { expect(critic.problems[file_name].first[:type]).to eq 'max_code_lines_in_method' }
|
55
|
+
specify { expect(critic.problems[file_name].first[:line]).to eq 1 }
|
56
|
+
specify { expect(critic.problems[file_name].first[:column]).to eq 0 }
|
57
|
+
specify { expect(critic.problems[file_name].first[:level]).to eq :error }
|
60
58
|
end
|
61
59
|
end
|
@@ -6,7 +6,7 @@ require 'tailor/configuration/style'
|
|
6
6
|
|
7
7
|
describe 'Vertical Space problem detection' do
|
8
8
|
before do
|
9
|
-
Tailor::Logger.
|
9
|
+
allow(Tailor::Logger).to receive(:log)
|
10
10
|
FakeFS.activate!
|
11
11
|
end
|
12
12
|
|
@@ -28,9 +28,9 @@ describe 'Vertical Space problem detection' do
|
|
28
28
|
File.open(file_name, 'w') { |f| f.write contents }
|
29
29
|
end
|
30
30
|
|
31
|
-
it '
|
31
|
+
it 'is OK' do
|
32
32
|
critic.check_file(file_name, style.to_hash)
|
33
|
-
critic.problems.
|
33
|
+
expect(critic.problems).to eq(file_name => [])
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|