Sha256: 35802eb9c6093a9c5f1ecebee5cac2ed7ab9e0220c14f30f40d1663fbebe8257

Contents?: true

Size: 673 Bytes

Versions: 28

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'appmap/util'

describe AppMap::Util, docker: false do
  let(:subject) { AppMap::Util.method(:scenario_filename) }
  describe 'scenario_filename' do
    it 'leaves short names alone' do
      expect(subject.call('foobar')).to eq('foobar.appmap.json')
    end
    it 'has a customizable suffix' do
      expect(subject.call('foobar', extension: '.json')).to eq('foobar.json')
    end
    it 'limits the filename length' do
      fname = (0...104).map { |i| ((i % 26) + 97).chr }.join

      expect(subject.call(fname, max_length: 50)).to eq('abcdefghijklmno-RAd_SFbH1sUZ_OXfwPsfzw.appmap.json')
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
appmap-0.46.0 spec/util_spec.rb
appmap-0.45.1 spec/util_spec.rb
appmap-0.45.0 spec/util_spec.rb
appmap-0.44.0 spec/util_spec.rb
appmap-0.43.0 spec/util_spec.rb
appmap-0.42.1 spec/util_spec.rb
appmap-0.42.0 spec/util_spec.rb
appmap-0.41.2 spec/util_spec.rb
appmap-0.41.1 spec/util_spec.rb
appmap-0.41.0 spec/util_spec.rb
appmap-0.40.0 spec/util_spec.rb
appmap-0.39.1 spec/util_spec.rb
appmap-0.39.0 spec/util_spec.rb
appmap-0.38.1 spec/util_spec.rb
appmap-0.37.2 spec/util_spec.rb
appmap-0.37.0 spec/util_spec.rb
appmap-0.36.0 spec/util_spec.rb
appmap-0.35.2 spec/util_spec.rb
appmap-0.35.1 spec/util_spec.rb
appmap-0.35.0 spec/util_spec.rb