gitlab-org--gitlab-foss/spec/models/packages/npm_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
547 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Packages::Npm do
using RSpec::Parameterized::TableSyntax
describe '.scope_of' do
subject { described_class.scope_of(package_name) }
where(:package_name, :expected_result) do
nil | nil
'test' | nil
'@test' | nil
'test/package' | nil
'@/package' | nil
'@test/package' | 'test'
'@test/' | nil
end
with_them do
it { is_expected.to eq(expected_result) }
end
end
end