Skip to content

Commit

Permalink
(CAT-1488) - Split around(:all) into before/after(:all)
Browse files Browse the repository at this point in the history
This fixes duplicate code warnings occurring during the acceptance
tests.

Signed-off-by: Gavin Didrichsen <[email protected]>
  • Loading branch information
gavindidrichsen committed Oct 5, 2023
1 parent c675464 commit cec5a47
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/acceptance/test_unit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
include_context 'with a fake TTY'

shared_context 'with spec file' do |filename, content|
around(:all) do |example|
before(:all) do
path = File.join('spec', 'unit', filename)
FileUtils.mkdir_p(File.dirname(path))
File.open(path, 'w') { |f| f.puts content }
example.run
end

after(:all) do
FileUtils.rm_f(path)
end
end
Expand Down

0 comments on commit cec5a47

Please sign in to comment.