BigW Consortium Gitlab

package_json_spec.rb 550 Bytes
Newer Older
1 2
require 'spec_helper'

3
describe BlobViewer::PackageJson do
4 5
  include FakeBlobHelpers

6
  let(:project) { build_stubbed(:project) }
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
  let(:data) do
    <<-SPEC.strip_heredoc
      {
        "name": "module-name",
        "version": "10.3.1"
      }
    SPEC
  end
  let(:blob) { fake_blob(path: 'package.json', data: data) }
  subject { described_class.new(blob) }

  describe '#package_name' do
    it 'returns the package name' do
      expect(subject).to receive(:prepare!)

      expect(subject.package_name).to eq('module-name')
    end
  end
end