Skip to content

Commit 617c366

Browse files
committed
post review fixes
1 parent d739db7 commit 617c366

File tree

2 files changed

+12
-34
lines changed

2 files changed

+12
-34
lines changed
File renamed without changes.

spec/bashly/commands/add_spec.rb

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@
1414

1515
context 'without arguments' do
1616
it 'shows long usage' do
17-
expect { subject.execute %w[add] }.to output_approval('cli/generate/usage')
17+
expect { subject.execute %w[add] }.to output_approval('cli/add/usage')
1818
end
1919
end
2020

2121
context 'with colors command' do
2222
let(:lib_file) { "#{source_dir}/lib/colors.sh" }
2323

24-
before do
25-
reset_tmp_dir create_src: true
26-
end
24+
before { reset_tmp_dir create_src: true }
2725

2826
it 'copies the colors.sh lib file to the user space' do
2927
expect { subject.execute %w[add colors] }.to output_approval('cli/add/colors')
@@ -32,9 +30,7 @@
3230
end
3331

3432
context 'with comp command' do
35-
before do
36-
reset_tmp_dir init: true
37-
end
33+
before { reset_tmp_dir init: true }
3834

3935
context 'with yaml subcommand' do
4036
it 'creates completions.yml' do
@@ -67,9 +63,7 @@
6763
context 'with config command' do
6864
let(:lib_file) { "#{source_dir}/lib/config.sh" }
6965

70-
before do
71-
reset_tmp_dir create_src: true
72-
end
66+
before { reset_tmp_dir create_src: true }
7367

7468
it 'copies the config.sh lib file to the user space' do
7569
expect { subject.execute %w[add config] }.to output_approval('cli/add/config')
@@ -80,9 +74,7 @@
8074
context 'with help command' do
8175
let(:help_command_file) { "#{source_dir}/help_command.sh" }
8276

83-
before do
84-
reset_tmp_dir init: true
85-
end
77+
before { reset_tmp_dir init: true }
8678

8779
it 'copies the help_command.sh lib file to the user space' do
8880
expect { subject.execute %w[add help] }.to output_approval('cli/add/help_command')
@@ -93,9 +85,7 @@
9385
context 'with lib command' do
9486
let(:lib_file) { "#{source_dir}/lib/sample_function.sh" }
9587

96-
before do
97-
reset_tmp_dir create_src: true
98-
end
88+
before { reset_tmp_dir create_src: true }
9989

10090
it 'copies a sample function to the user space under lib directory' do
10191
expect { subject.execute %w[add lib] }.to output_approval('cli/add/lib')
@@ -107,9 +97,7 @@
10797
let(:settings_file) { "#{target_dir}/settings.yml" }
10898
let(:template_file) { 'lib/bashly/templates/settings.yml' }
10999

110-
before do
111-
reset_tmp_dir
112-
end
100+
before { reset_tmp_dir }
113101

114102
it 'copies the settings file to the current directory' do
115103
expect do
@@ -136,19 +124,15 @@
136124
context 'with strings command' do
137125
let(:strings_file) { "#{source_dir}/bashly-strings.yml" }
138126

139-
before do
140-
reset_tmp_dir create_src: true
141-
end
127+
before { reset_tmp_dir create_src: true }
142128

143129
it 'copies the strings configuration to the user space' do
144130
expect { subject.execute %w[add strings] }.to output_approval('cli/add/strings')
145131
expect(File).to exist(strings_file)
146132
end
147133

148134
context 'when the source directory does not exist' do
149-
before do
150-
reset_tmp_dir
151-
end
135+
before { reset_tmp_dir }
152136

153137
it 'raises an error' do
154138
expect { subject.execute %w[add strings] }.to raise_error(InitError, /does not exist/)
@@ -166,9 +150,7 @@
166150
context 'with test command' do
167151
let(:lib_file) { "#{target_dir}/test/approvals.bash" }
168152

169-
before do
170-
reset_tmp_dir create_src: true
171-
end
153+
before { reset_tmp_dir create_src: true }
172154

173155
it 'copies the test folder to the user space' do
174156
expect { subject.execute %w[add test] }.to output_approval('cli/add/test')
@@ -179,9 +161,7 @@
179161
context 'with validations command' do
180162
let(:lib_file) { "#{source_dir}/lib/validations/validate_integer.sh" }
181163

182-
before do
183-
reset_tmp_dir create_src: true
184-
end
164+
before { reset_tmp_dir create_src: true }
185165

186166
it 'copies the validation lib folder to the user space' do
187167
expect { subject.execute %w[add validations] }.to output_approval('cli/add/validations')
@@ -192,9 +172,7 @@
192172
context 'with yaml command' do
193173
let(:lib_file) { "#{source_dir}/lib/yaml.sh" }
194174

195-
before do
196-
reset_tmp_dir create_src: true
197-
end
175+
before { reset_tmp_dir create_src: true }
198176

199177
it 'copies the yaml.sh lib file to the user space' do
200178
expect { subject.execute %w[add yaml] }.to output_approval('cli/add/yaml')

0 commit comments

Comments
 (0)