-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create test for agent_helper in gem files #2118
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4049ec6
Create test for agent_helper in gem files
kaylareopelle cc2cc4b
CI: gemspec files test - bypass cache
fallwith 590bfd3
Gemspec: use full path to .build_ignore
fallwith bbc9651
CI gemspec test: skip 'env' tests incl. norails
fallwith 7fcd753
gemspec tests: don't skip 'norails'
fallwith 367ce77
Gemspec test: don't run on old Rubygems versions
fallwith 91265ef
Merge pull request #2130 from newrelic/composure
fallwith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# This file is distributed under New Relic's license terms. | ||
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details. | ||
# frozen_string_literal: true | ||
|
||
require 'minitest/autorun' | ||
|
||
class GemspecFilesTest < Minitest::Test | ||
def test_the_test_agent_helper_is_shipped_in_the_gem_files | ||
skip if defined?(Rails::VERSION) | ||
skip 'Gemspec test requires a newer version of Rubygems' unless Gem.respond_to?(:open_file) | ||
|
||
gem_spec_file_path = File.expand_path('../../../newrelic_rpm.gemspec', __FILE__) | ||
|
||
Dir.chdir(File.dirname(gem_spec_file_path)) do | ||
gem_spec = eval(Gem.open_file(gem_spec_file_path, 'r:UTF-8:-', &:read)) | ||
|
||
assert gem_spec, "Failed to parse '#{gem_spec_file_path}'" | ||
assert_equal('newrelic_rpm', gem_spec.name) | ||
assert_includes(gem_spec.files, 'test/agent_helper.rb') | ||
end | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajesler - I swapped out the
test_helper
require statement withminitest/autorun
because we don't want/need the agent to be loaded for this particular test.This is what we do with our other utilities, like our
CveNotifierTests