Skip to content

Commit

Permalink
add release gem spec
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Sep 11, 2023
1 parent bf18835 commit 6b6e593
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions spec/datadog/ci/release_gem_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
RSpec.describe "gem release process" do
context "datadog-ci.gemspec" do
context "files" do
subject(:files) { Gem::Specification.load("datadog-ci.gemspec").files }

# It's easy to forget to ship new files, especially when a new paradigm is
# introduced (e.g. introducing native files requires the inclusion `ext/`)
it "includes all important files" do
single_files_excluded = /
^
(
|\.env
|\.gitignore
|\.rspec
|\.rubocop.yml
|\.standard.yml
|\.standard_todo.yml
|\.simplecov
|\.yardopts
|Appraisals
|CODE_OF_CONDUCT.md
|CONTRIBUTING.md
|Gemfile
|Gemfile-.*
|Rakefile
|Steepfile
|datadog-ci\.gemspec
|docker-compose\.yml
)
$
/x

directories_excluded = %r{
^(
spec
|docs
|\.circleci
|\.github
|\.vscode
| bin
|gemfiles
|integration
|tasks
|yard
|vendor/rbs
)/
}x

expect(files)
.to match_array(
`git ls-files -z`
.split("\x0")
.reject { |f| f.match(directories_excluded) }
.reject { |f| f.match(single_files_excluded) }
)
end
end
end
end

0 comments on commit 6b6e593

Please sign in to comment.