Skip to content

Commit

Permalink
Use packs/rspec/support to simplify testing (#29)
Browse files Browse the repository at this point in the history
* bump packs

* Use packs/rspec/support
  • Loading branch information
Alex Evanczuk authored Dec 29, 2022
1 parent ed56424 commit 2e43d78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GEM
coderay (1.1.3)
diff-lcs (1.4.4)
method_source (1.0.0)
packs (0.0.2)
packs (0.0.5)
sorbet-runtime
parser (3.1.2.0)
ast (~> 2.4.1)
Expand Down
19 changes: 1 addition & 18 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'pry'
require 'code_ownership'
require 'code_teams'

require 'packs/rspec/support'
require_relative 'support/application_fixtures'

RSpec.configure do |config|
Expand All @@ -16,28 +16,11 @@
c.syntax = :expect
end

config.around do |example|
prefix = [File.basename($0), Process.pid].join('-') # rubocop:disable Style/SpecialGlobalVars
tmpdir = Dir.mktmpdir(prefix)
Dir.chdir(tmpdir) do
example.run
end
ensure
FileUtils.rm_rf(tmpdir)
end

config.include_context 'application fixtures'

config.before do
CodeOwnership.bust_caches!
CodeTeams.bust_caches!
Packs.bust_cache!
allow(CodeTeams::Plugin).to receive(:registry).and_return({})
end
end

def write_file(path, content = '')
pathname = Pathname.new(path)
FileUtils.mkdir_p(pathname.dirname)
pathname.write(content)
end

0 comments on commit 2e43d78

Please sign in to comment.