Sha256: 9dd18bdafafedaca753ce4bd46059b0c72b369f02fbc1d598bcc9979c1805a03

Contents?: true

Size: 936 Bytes

Versions: 11

Compression:

Stored size: 936 Bytes

Contents

RSpec.describe Licensee::Project::File do
  let(:filename) { 'LICENSE.txt' }
  let(:mit) { Licensee::License.find('mit') }
  let(:content) { mit.content }
  let(:possible_matchers) { [Licensee::Matchers::Exact] }

  subject { described_class.new(content, filename) }
  before do
    allow(subject).to receive(:possible_matchers).and_return(possible_matchers)
  end
  before { allow(subject).to receive(:length).and_return(mit.length) }
  before { allow(subject).to receive(:wordset).and_return(mit.wordset) }

  it 'stores the content' do
    expect(subject.content).to eql(content)
  end

  it 'stores the filename' do
    expect(subject.filename).to eql(filename)
  end

  it 'returns the matcher' do
    expect(subject.matcher).to be_a(Licensee::Matchers::Exact)
  end

  it 'returns the confidence' do
    expect(subject.confidence).to eql(100)
  end

  it 'returns the license' do
    expect(subject.license).to eql(mit)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
licensee-8.9.2 spec/project_file_spec.rb
licensee-8.9.0 spec/project_file_spec.rb
licensee-8.8.5 spec/project_file_spec.rb
licensee-8.8.4 spec/project_file_spec.rb
licensee-8.8.3 spec/project_file_spec.rb
licensee-8.8.2 spec/project_file_spec.rb
licensee-8.8.1 spec/project_file_spec.rb
licensee-8.8.0 spec/project_file_spec.rb
licensee-8.7.0 spec/project_file_spec.rb
licensee-8.6.1 spec/project_file_spec.rb
licensee-8.6.0 spec/project_file_spec.rb