-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2118 from newrelic/2117_gemspec_test
Create test for agent_helper in gem files
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
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 |