Skip to content

Commit eaf308c

Browse files
committed
Adds a test for the purl helper method
This was mainly done to make sure the `simplecov` configuration was working correctly. Signed-off-by: M. Scott Ford <[email protected]>
1 parent 617f1bd commit eaf308c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

spec/bom_helpers_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require 'spec_helper'
2+
require 'bom_helpers'
3+
4+
RSpec.describe 'helper methods' do
5+
context '#purl' do
6+
it 'builds a purl' do
7+
expect(purl('activesupport', '7.0.1')).to eq("pkg:gem/[email protected]")
8+
end
9+
end
10+
end

spec/spec_helper.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copied from https://github.com/cucumber/aruba/blob/3b1a6cea6e3ba55370c3396eef0a955aeb40f287/spec/spec_helper.rb
2+
# Licensed under MIT - https://github.com/cucumber/aruba/blob/3b1a6cea6e3ba55370c3396eef0a955aeb40f287/LICENSE
3+
4+
$LOAD_PATH << File.expand_path('../lib', __dir__)
5+
6+
unless RUBY_PLATFORM.include?('java')
7+
require 'simplecov'
8+
SimpleCov.command_name 'RSpec'
9+
10+
# Run simplecov by default
11+
SimpleCov.start unless ENV.key? 'ARUBA_NO_COVERAGE'
12+
end
13+
14+
# Loading support files
15+
Dir.glob(File.expand_path('support/*.rb', __dir__)).sort.each { |f| require_relative f }
16+
Dir.glob(File.expand_path('support/**/*.rb', __dir__)).sort.each { |f| require_relative f }

0 commit comments

Comments
 (0)